flat-hospital-33004
07/04/2025, 7:10 AMmagnificent-energy-493
magnificent-energy-493
kratos.yml
, the UI will automatically display the "Sign in with Azure" button as part of the OIDC method group. The UI simply renders what Kratos provides in the flow data—no provider-specific code is required*12*.
1. Register your application in Azure and obtain the Client ID, Client Secret, and set the correct Redirect URI (matching the pattern required by Kratos).
2. Configure Azure as an OIDC provider in your kratos.yml
. This includes setting the client_id
, client_secret
, issuer_url
, and a Jsonnet data mapping for claims.
3. Set up the redirect URI in both Azure and Kratos to match the required pattern: http(s)://<domain-of-ory-kratos>:<public-port>/self-service/methods/oidc/callback/<provider-id>
4. Add the session hook to your Kratos config to avoid users needing to log in again after sign-up:
5. selfservice:
6. flows:
7. registration:
8. after:
9. oidc:
10. hooks:
11. - hook: session
12. Run the self-service UI. When the login flow is initialized, Kratos will include the OIDC method and the UI will render the Azure login button automatically*12*.
13. Test the flow: When a user clicks the Azure login button, the UI will POST to Kratos, which will handle the redirect to Azure and back.
For more details, see the OIDC provider configuration guide and the Azure-specific setup.