File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -681,25 +681,32 @@ export function buildDiscoveryUrls(authorizationServerUrl: string | URL): { url:
681
681
pathname = pathname . slice ( 0 , - 1 ) ;
682
682
}
683
683
684
- // 1. OAuth metadata at the given URL
684
+ // OAuth metadata at the given URL
685
685
// Insert well-known before the path: https://example.com/.well-known/oauth-authorization-server/tenant1
686
686
urlsToTry . push ( {
687
687
url : new URL ( `/.well-known/oauth-authorization-server${ pathname } ` , url . origin ) ,
688
688
type : 'oauth'
689
689
} ) ;
690
690
691
+ // Some servers like Okta append the well-known after the path
692
+ urlsToTry . push ( {
693
+ url : new URL ( `${ pathname } /.well-known/oauth-authorization-server` , url . origin ) ,
694
+ type : 'oauth'
695
+ } ) ;
696
+
691
697
// Root path: https://example.com/.well-known/oauth-authorization-server
692
698
urlsToTry . push ( {
693
699
url : new URL ( '/.well-known/oauth-authorization-server' , url . origin ) ,
694
700
type : 'oauth'
695
701
} ) ;
696
702
697
- // 3. OIDC metadata endpoints
703
+ // OIDC metadata endpoints
698
704
// RFC 8414 style: Insert /.well-known/openid-configuration before the path
699
705
urlsToTry . push ( {
700
706
url : new URL ( `/.well-known/openid-configuration${ pathname } ` , url . origin ) ,
701
707
type : 'oidc'
702
708
} ) ;
709
+
703
710
// OIDC Discovery 1.0 style: Append /.well-known/openid-configuration after the path
704
711
urlsToTry . push ( {
705
712
url : new URL ( `${ pathname } /.well-known/openid-configuration` , url . origin ) ,
You can’t perform that action at this time.
0 commit comments