D2lvalenceElixir.Auth.D2LAppContext.create_url_for_authentication
create_url_for_authentication
, go back to D2lvalenceElixir.Auth.D2LAppContext module for more information.
create_url_for_authentication(app_context, host, client_app_url, connect_type \\ nil, encrypt_request \\ true)
View SourceBuild a URL that the user's browser can employ to complete the user authentication process with the back-end LMS.
:param host:
Host/port string for the back-end LMS service (i.e. lms.someUni.edu:443
).
To this parameter, this function adds the appropriate API route and parameters for a user-authentication request.
:param client_app_url:
Client application URL that the back-end service should redirect the user back to after user-authentication.
:param connect_type:
Provide a type string value of mobile
to signal to the back-end service that the user-context will connect from a mobile device.
:param encrypt_request:
If true (default), generate an URL using a secure scheme (HTTPS); otherwise, generate an URL for an unsecure scheme (HTTP).
Examples
iex> D2lvalenceElixir.Auth.D2LAppContext.create_url_for_authentication(%D2lvalenceElixir.Auth.D2LAppContext{app_id: "J5fm9B0Rq934mBQV9fGLWP", app_key: "rYBPwHlBy0wPxlP-QZPedr"}, "lms.someUni.edu:443", "http://localhost:8080/token")
"https://lms.someUni.edu:443/d2l/auth/api/token?x_a=J5fm9B0Rq934mBQV9fGLWP&x_b=-4KVKL-uNYeXopvBXFdM0SHZgyiQCVWu0oDmF5JkL48&x_target=http%3A%2F%2Flocalhost%3A8080%2Ftoken"