I have a requirement to authenticate Microsoft Entra ID to DX API. Some context below:
React SPA has the front end.
-PEGA is the backend engine, DX API is exposed for orchestration.
React authenticates the user using MSAL and it retrieves a Graph token User.Read. Later on React goes again to Entra ID to get an acces_as_user token for PEGA (All security rules in PEGA).
React team wants to use these tokens straight to DX api so we validate the identity of the consumer in the DX API. I’m following some approaches already mentioned here in the forums:
My questions:
1st: DX API requires Oath2.0. Can this be changed? I wouldn’t suggested it.
2nd: I’m suggesting a gateway in the middle to handle the client secret and authorization (access_as_read token to oath/v1/token and issuing a PEGA token with the identity already validated to IdentityMapping/TokenProfile/Truststore keystore). But it will have to use a backend for frontend. Is this the right approach?
Edit: Notice that OAuth2.0 rule uses a secret and cannot be saved in SPA session
I would appreaciate any comment on this matter. Thank you in advance.
We did a similar POC where we have installed the required SDK package in an external angular application and setup the OID token to load the Constellation JS config so that we can call the necessary DX API for case creation and other stuff.
You can find the posts for reference
Have a go at it and let us know if you have any further questions
Update.
We used oath2/v1/token to sign our own token, involved Microsoft API management in between to handle secrets. Now DX API is working fine, each operator is updating/creating/receiving appropiate work based on its group/role and seems to be working fine. We didn’t change any DX api OOTB strategy.