Skip to content

Figure out a strategy for handling Azure #344

Open
@ericchiang

Description

@ericchiang

It would be good if this package correctly and safely picked the issuer and discovery values for Azure AD. There are nuances about the tentantID and policyName that I'm not super familiar with, and these continue to be reported as issues:

Based off of what I've seen, these can be grouped as:

  • Azure takes and returns a dynamic "issuer" value in its metadata. Sometimes it has a placeholder "{tenantid}" value, sometimes it doesn't.
  • Azure requires a URL query parameter as part of discovery ("?p={policyName}").
  • I've also heard that the returned ID token "iss" can sometimes be global and other times tenant specific.

Upstream issues with Azure:

Current workarounds implemented in go-oidc are the ability to create custom Provider and RemoteKeySet objects without using discovery:

Open questions are:

  • What is the correct issuer value to expect in an ID Token issued by Azure AD? Are these dependent on tenant or policy?
  • What is the correct discovery URL to use for Azure AD? Are these dependent on tenant or policy?
  • What are the URL parameters consumed by Azure AD? What are the correct values for these?

I've been hesitant to provide concrete advice, since choosing the wrong issuer can be an easy way to end up with a vulnerable application. Maybe it's time to figure this out?


The relevant spec links:

The issuer value returned MUST be identical to the Issuer URL that was directly used to retrieve the configuration information.

https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationValidation

The returned Issuer location MUST be a URI RFC 3986 [RFC3986] with a scheme component that MUST be https, a host component, and optionally, port and path components and no query or fragment components

https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery

OpenID Providers supporting Discovery MUST make a JSON document available at the path formed by concatenating the string /.well-known/openid-configuration to the Issuer.

https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions