oauth - SSO to 3rd party through AzureAD - Stack Overflow

时间: 2025-01-06 admin 业界

I am confused in the actual flow to implement for what I want :

I have a private Laravel app with its own users which crefentials are stored in my database. Users when logged, can click a button to be redirected and immediately logged to a 3rd party website through SSO. That 3rd party website implements OIDC through AzureAD but I am still not sure how to implement it and which flow fits my case (authorization code, etc)

After some research, I noted the following steps :

  • create a service account in AzureAD to get my client id and secret
  • sync my current users to AzureAD to my app' specific tenant, with a random generated password (it does not matter since they will never use it and will not be aware of it) to get their azure object ids which I will save to database
  • using the service account credentials, request for an access token to consume the API that allows to retrieve an azure object user' specific ID token
  • redirect through form POST to 3rd party website passing the ID token with immediate auto submission of the form
  • 3rd party website validates the ID token with AzureAD and logs the user

Please let me know if any step is missing or if it is the right implementation ?