I'm trying to configure an Azure App Service that uses the OpenID possibility of IAM to authenticate users. The app service is a website with static content and should be protected using an OpenID Connect provider:
https://docs.microsoft.com/en-us/azure/app-service/configure-authentication-provider-openid-connect
I’ve tried to set this up, but I struggle with both the configuration in Azure and in IAM.
When I use the example document from Microsoft documentation (below) from Apple ID it does redirect me to the Apple ID login page, on which I assume should work when correctly set up;
{
"platform": {
"enabled": true
},
"globalValidation": {
"redirectToProvider": "apple",
"unauthenticatedClientAction": "RedirectToLoginPage"
},
"identityProviders": {
"openIdConnectProviders": {
"apple": {
"registration": {
"clientId": "com.contoso.example.client",
"clientCredential": {
"secretSettingName": "APPLE_GENERATED_CLIENT_SECRET"
},
"openIdConnectConfiguration": {
"wellKnownOpenIdConfiguration": "https://appleid.apple.com/.well-known/openid-configuration"
}
},
"login": {
"nameClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"scope": :],
"loginParameterNames": :]
}
}
}
},
"login": {
"tokenStore": {
"enabled": true
}
}
}
There are some settings that need to be changed, or set up different.
- clientId > value in IAM
- secretSettingName (value) > should match with a value in IAM
- the wellKnownOpenIdConfiguration: What URL should this be? https://server/indicium/.well-known/openid-configuration does not exist.
Is this possible to use and what values should be used? The config file is specified over here (section openIdConnectProviders):
https://docs.microsoft.com/en-us/azure/app-service/app-service-authentication-how-to#config-file
"openIdConnectProviders": {
"<providerName>": {
"enabled": <true|false>,
"registration": {
"clientId": "<client id>",
"clientCredential": {
"clientSecretSettingName": "<name of app setting containing client secret>"
},
"openIdConnectConfiguration": {
"authorizationEndpoint": "<url specifying authorization endpoint>",
"tokenEndpoint": "<url specifying token endpoint>",
"issuer": "<url specifying issuer>",
"certificationUri": "<url specifying jwks endpoint>",
"wellKnownOpenIdConfiguration": "<url specifying .well-known/open-id-configuration endpoint - if this property is set, the other properties of this object are ignored, and authorizationEndpoint, tokenEndpoint, issuer, and certificationUri are set to the corresponding values listed at this endpoint>"
}
},
"login": {
"nameClaimType": "<name of claim containing name>",
"scopes": "
"openid",
"profile",
"email"
],
"loginParameterNames": "
"paramName1=value1",
"paramName2=value2"
],
}
},
//...
}
I'm not sure if the wellKnownOpenIdConfiguration should be used or that the authorizationEndpoint, tokenEndpoint, issuer etc should be configured.
On the IAM side of this I've only added an OpenID client and added a ‘secret’ under “Configuration”.
Any thoughts about how to solve this?