Oidc not working with Azure AD

Hi,

I am trying to get SSO implemented with Azure AD connecting to Open ID Connect in ChirpStack, but it doesn’t seem to be working. I hit a loop where we get the error below.
image

Just for the sake of asking, do users already have to be in the user table before SSO will work?
I also have the ‘registration’ config variable set to true, so this shouldn’t be an issue unless the functionality is bugged.

Can anyone provide a sanitized example of how these fields would be populated, particularly the Email field? I am using the docker images at log level info, but it isn’t giving significantly helpful logs, debug didn’t give anything helpful either unfortunately. Getting a sample for this would be very helpful for my investigation, thanks.
image

Thanks in advance for any help anyone can give.

Would really appreciate if anyone could provide a hand on this?

I have no experience with Azure AD, but is the returned email_verified field set to true in the OIDC claims? I believe that is what the error is about.

1 Like

Hi Orne,

We were thinking that may be part of the issue, but were having trouble modifying the code to debug. Is there any way to turn off the dependency on email_verified or is that fully integrated into the code, as I see the implementation of Azure AD I have to communicate with doesn’t have email_verified as a usual field.

There is no worry if this is not easily doable, I am just trying to get as many options as possible.

Thanks for the response regardless!

@brocaar Hi Orne,

While it might not be feasible, would there be some possibility of making the email_verified field optional? I have seen in OIDC docs that it is an optional claim.

It would be great if this could be supplied as env variable through conf. Default value we can supply ourselves, otherwise if exists in OIDC token, pull that value.

This might obviously not be an improvement, so just a suggestion.

Thanks

Isn’t there a way to make sure that Azure AD returns email_verified true? The reason why this is validated is that if an user already exists within ChirpStack the email will be used to associated the OIDC provided id with the user within ChirpStack.

Therefore you really want to make sure that the OIDC provided email is validated, as else there could be an option that somebody could hijack other accounts.

Do you have any (references to) documentation about the Azure AD returned claims?

Hi Orne,

I have contacted people to make changes, but I have hit another problem. I have asked the people that handle the Azure side of things to add email_verified as a field, so that part is fine, but I am now hitting an issue that might be related to GO itself, and you might be able to lend a hand to.

Our SSO is mostly working, but for the fact that the code cannot seem to handle email_verified, however the value arrives as a string, and we are now getting the error that it is not handling the unmarshal correctly as it only expects a bool.

image

I have seen an answer on StackOverflow surrounding a similar issue and this was the proposed fix. I suppose it tells the marshaller to potentially expect to parse a string?
image

What is your opinion on this?