MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / loginMethodToAMR

Function loginMethodToAMR

internal/token/auth_token.go:71–90  ·  view source on GitHub ↗

loginMethodToAMR maps an internal LoginMethod value to the OIDC Core §2 Authentication Methods Reference array. Returns nil (omit the claim) for unknown or empty methods.

(method string)

Source from the content-addressed store, hash-verified

69// Authentication Methods Reference array. Returns nil (omit the claim)
70// for unknown or empty methods.
71func loginMethodToAMR(method string) []string {
72 switch strings.ToLower(method) {
73 case constants.AuthRecipeMethodBasicAuth, constants.AuthRecipeMethodMobileBasicAuth:
74 return []string{"pwd"}
75 case constants.AuthRecipeMethodMagicLinkLogin, constants.AuthRecipeMethodMobileOTP:
76 return []string{"otp"}
77 case constants.AuthRecipeMethodGoogle,
78 constants.AuthRecipeMethodGithub,
79 constants.AuthRecipeMethodFacebook,
80 constants.AuthRecipeMethodLinkedIn,
81 constants.AuthRecipeMethodApple,
82 constants.AuthRecipeMethodDiscord,
83 constants.AuthRecipeMethodTwitter,
84 constants.AuthRecipeMethodTwitch,
85 constants.AuthRecipeMethodRoblox,
86 constants.AuthRecipeMethodMicrosoft:
87 return []string{"fed"}
88 }
89 return nil
90}
91
92// JWTToken is a struct to hold JWT token and its expiration time
93type JWTToken struct {

Callers 1

CreateIDTokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected