How to establish connection and make API calls to Brightspace (to create a user and enroll the us...

Options

How to establish connection and make API calls to Brightspace (to create a user and enroll the user to a specific course) ?
 

I have a web application that handles user authentication. Once the user is logged in, his/her eligibility for a course is checked (internal logic). If user is eligible for a course, I would like to make API call to enroll this user to the course and generate a link that can be used by the user to start course learning (without entering his/her credentials because user is already authenticated).

 

I am trying to achieve this using C# or JavaScript. I tried valance authentication (with App ID and App Key), I am able to call WhoAmI() method, but I had to enter the credentials when Valance Authentication redirected me to login page.  

 

I also tried to follow SSO documentation is Brightspace community site, but I am finding it hard to understand the process. 

 

Could you direct me to the right solution, please? I would appreciate if you could share a sample in C# or JavaScript that uses SSO authentication.