Pega SSO using OpenID connect authentication service

We can create a new OpenID Connect authentication service in Pega using google as the OpenID Identity provider and how we can log in Pega using the google credentials.Pega supports OpenID authentication service in versions 7.4 & above.

















Sequence of steps in this implementation:
1) User tries to login into a Pega application using Google login credentials
2) Pega application sends an auth request to Google(OpenID Identity Provider)
3) A Google login screen appears and allows the user to enter id/pwd to pass the credentials to Identity Provider
4) Google generates an auth code and sends it back to Pega app
5) After receiving the auth code, Pega requests for an access token and receives it from the Identity Provider
6) After getting the token, Pega sends a request and retrieves the user info necessary for authentication

To work on the above steps, we need to login into google's developer portal: https://console.developers.google.com/project?pli=1 and 
1) Create a new project:PegaProject
2) Go to OAuth Consent Screen and select the User Type as External before filling the basic info(app name, logo, email) in Consent screen
3) Select Credentials for an OAuth client ID option. Choose the Web application and give a name:PegaClient. Click on the Add URI button in the bottom of the screen and add the URI:http://localhost:8080/prweb/PRAuth before click Save button
4) Note down the Client ID, Client secret in a notepad and will be used in Pega authentication service later





















The next configuration is from Pega side to finish the process.
1) In Pega Dev Studio, click Configure -> Org & Security -> Authentication -> Create Authentication service and create a name to follow the next steps
2) Enter the OpenID Connect provider config details as mentioned in below image
3) Time to create a Keystore instance to use in ID Token processing section. For this, the Issuer is accounts.google.com and the OAuth Keystore instance is based on the option:Reference to URL and JSON web key (JWK) as Keystore type. See the below image for more info.
Note: If your sys is not allowing to call the Keystore url then you can open that URL in a browser and store it like "certs.json" and select Upload file option to load it in the Keystore instane
4) Client information is filled with Clien id, secret noted in the notepad earlier. See the below image for more
5) Follow the screenshot to add the Operator identification section and make sure to have model operator id created in the sys. In my case, it is AzureOp where it opens the manager portal after successful authentication process done. See the sample image given below.  













































Now it is the time to test this functionality. Before testing, clear the browser cache and type the URL given in the authentication service instance. In my case, it is like http://localhost:8080/prweb/PRAuth/GoogleSSO. After entering the gmail id/pwd, browser rediects to Pega portal as per the access group selected in the model operator. See the final screenshot which I got manager portal in my case. 



References:
1) google.com
2) community.pega.com
3) Pega developer help

Popular posts from this blog

Connecting Claude to Pega Infinity 25.1.3 via MCP — Step-by-Step

itextpdf API to generate PDF doc from an image file using Pega PE

Understanding of Hugging Face platform for AI/ML platform