Does anyone have experience with using Azure AD Open ID Connect for Authentication ?
Following Sensu’s Documentation for Authentication with OIDC we tried to implement OIDC with an Azure AD OIDC Application. We’re using OpenID for other Products in combination with Azure AD and they work, so we thought to give it try with Sensu as we don’t have a classic Active Directory in our Cloud Environment. We used the following config …
{
“type”: “oidc”,
“api_version”: “authentication/v2”,
“metadata”: {
“name”: “azuread”
},
“spec”: {
“additional_scopes”: [
“upn”, “groups”
],
“client_id”: “”,
“client_secret”: “”,
“server”: “https://login.microsoftonline.com//v2.0”,
“redirect_uri”: “https://:8080/api/enterprise/authentication/v2/oidc/callback”,
“username_claim”: “upn”,
“username_prefix”: “aad:”,
“groups_claim”: “groups”,
“groups_prefix”: “aad:”
}
}
Unfortunately this does not work, after clicking on “Sign in with AZUREAD” on Sensu Dashboard we get the following error …
{“message”:"oauth2: cannot fetch token: 400 Bad Request\nResponse: {“error”:“invalid_request”,“error_description”:“AADSTS900144: The request body must contain the following parameter: ‘code’.\r\nTrace ID: e3ba6f08-f35b-4aea-9a39-7b5172754600\r\nCorrelation ID: f90aab99-45ab-40d8-9bf2-c2b1f81f14c1\r\nTimestamp: 2020-05-28 13:52:35Z”,“error_codes”:[900144],“timestamp”:“2020-05-28 13:52:35Z”,“trace_id”:“e3ba6f08-f35b-4aea-9a39-7b5172754600”,“correlation_id”:“f90aab99-45ab-40d8-9bf2-c2b1f81f14c1”,“error_uri”:“https://login.microsoftonline.com/error?code=900144"}","code”:0}
… if we remove the additional scopes, we get the following error message after successfully authenticating to our azure oidc provider …
{“message”:“UsernameClaim not found”,“code”:0}
Any idea where we could check what is wrong ? as we didn’t have any error in our sensu-backend logs that are related to this issue …
Thanks for your help in advance !