Skip to content

Conversation

@david-haraga
Copy link
Collaborator

  • support for multiple issuers

- support for multiple issuers
@david-haraga david-haraga requested a review from mmgopher October 24, 2025 17:01
@david-haraga david-haraga self-assigned this Oct 24, 2025
}

if false && discoveryConfig.Issuer != issuer {
if !slices.Contains(issuers, discoveryConfig.Issuer) {
Copy link

@mmgopher mmgopher Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How it is suppose to work? This check doesn't make sense for me. You do not know tenantid at this stage (for multi-tenant mode). For multi-tenant the issuer is https://login.microsoftonline.com/common/ and the dicoveryConfig.Issuer = https://sts.windows.net/{tenantid}/. The placeholder {tenantid} is not resolved with real tenantid. It will work only if you have string https://sts.windows.net/{tenantid}/ in the slice issuers []string

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, I have added https://sts.windows.net/{tenantid}/ to the permitted issuer list in config

if claims.GetIssuer() != issuer {
return fmt.Errorf("%w: Expected: %s, got: %s", ErrIssuerInvalid, issuer, claims.GetIssuer())
func CheckIssuer(claims Claims, issuers []string) error {
if !slices.Contains(issuers, claims.GetIssuer()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the check makes sense as claims.GetIssuer is the real issuer: https://sts.windows.net/26f2a995-d6fd-4a27-9e38-b8bac98e4ce5/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants