Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions internal/node/id_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ import (
// All IDP schemes supported by the ID generator.
// The ID generator creates IDs based on the proof and issuer information.
const (
OktaScheme = "OKTA-"
DuoScheme = "DUO-"
OryScheme = "ORY-"
IdpScheme = "IDP-"
PingScheme = "PING-"
SelfScheme = "AGNTCY-"
OktaScheme = "OKTA-"
DuoScheme = "DUO-"
OryScheme = "ORY-"
IdpScheme = "IDP-"
PingScheme = "PING-"
EntraScheme = "ENTRA-"
SelfScheme = "AGNTCY-"
)

type IDGenerator interface {
Expand Down Expand Up @@ -68,6 +69,8 @@ func (g *idGenerator) GenerateFromProof(
scheme = IdpScheme
case oidc.PingProviderName:
scheme = PingScheme
case oidc.EntraProviderName:
scheme = EntraScheme
case oidc.SelfProviderName:
scheme = SelfScheme
default:
Expand Down
1 change: 1 addition & 0 deletions pkg/oidc/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
OryProviderName
IdpProviderName
PingProviderName
EntraProviderName
SelfProviderName
)

Expand Down
6 changes: 6 additions & 0 deletions pkg/oidc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (p *parser) detectProviderName(
return DuoProviderName, nil
case isPing(headers, providerUrl.Host):
return PingProviderName, nil
case isEntra(headers, providerUrl.Host):
return EntraProviderName, nil
default:
return IdpProviderName, nil
}
Expand Down Expand Up @@ -62,6 +64,10 @@ func isPing(_ http.Header, host string) bool {
strings.HasSuffix(host, "pingone.ca")
}

func isEntra(_ http.Header, host string) bool {
return strings.HasSuffix(host, "microsoftonline.com")
}

func getProviderMetadata(ctx context.Context, issuer string) (*providerMetadata, error) {
metadata, oidcErr := getOidcProviderMetadata(ctx, issuer)
if oidcErr == nil {
Expand Down
Loading