The initial user authentication request follows the OAuth2 Authorization Grant Type flow. To initiate the OpenID Connect process, the user will be redirected to the OAuth2 authorization endpoint with the "openid profile" scope value. Additional scope values can be included to return specific profile scopes. The request is made to the authorization endpoint with the following parameters:
The client will then form the authorization URL and redirect the user to this URL via their user agent (i.e. browser). This can be performed in different ways depending on the client and the desired user experience. For example, a web application can just issue a HTTP 302 redirect to the browser and redirect the user to the authorization URL. A native mobile application may launch the mobile browser and open the authorization URL. The authorization URL using the values above would be:
https://sso.pingdeveloper.com/as/authorization.oauth ?client_id=ac_oic_client &response_type=code &redirect_uri=https://sso.pingdeveloper.com/OAuthPlayground/case1A-callback.jsp &scope=openid%20profile
For mobile application scenarios where it is not guaranteed that the app at the end of the redirect_uri is the intended application, the Proof Key for Code Exchange (PKCE) specification should be used to mitigate tokens being issued to an incorrect client. The "plain" variant of PKCE involves including a code_challenge parameter at this stage to link this authorization request with the subsequent token request (step 2 below). Therefore an example of a mobile authorization request (using com.pingidentity.developer.oauthplayground://oidc_callback as the redirect_uri) will be:
https://sso.pingdeveloper.com/as/authorization.oauth2 ?client_id=ac_oic_client &response_type=code &redirect_uri=com.pingidentity.developer.oauthplayground://oidc_callback &scope=openid%20profile &code_challenge=abcd-this-is-a-unique-per-request-value
The user will then be sent through the authentication process (i.e. prompted for their username/password at their IDP, authenticated via Kerberos or x509 certificate etc). Once the user authentication (and optional consent approval) is complete, the authorization code will be returned as a query string parameter to the redirect_uri specified in the authorization request.
GET https://sso.pingdeveloper.com/OAuthPlayground/Case1A callback.jsp?code=ABCâ€¦XYZ HTTP/1.1
(or for a mobile application, this URL will be handled in according to the mobile OS - for example in iOS in the AppDelegate class using the application:handleOpenUrl:function)