mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Add OpenID claims "profile" and "email". (#16141)
* Added OpenID claims "profile" and "email". * Splitted error. * Added scopes_supported and claims_supported. * Added more metadata. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
		| @@ -394,7 +394,7 @@ func (grant *OAuth2Grant) TableName() string { | ||||
| 	return "oauth2_grant" | ||||
| } | ||||
|  | ||||
| // GenerateNewAuthorizationCode generates a new authorization code for a grant and saves it to the databse | ||||
| // GenerateNewAuthorizationCode generates a new authorization code for a grant and saves it to the database | ||||
| func (grant *OAuth2Grant) GenerateNewAuthorizationCode(redirectURI, codeChallenge, codeChallengeMethod string) (*OAuth2AuthorizationCode, error) { | ||||
| 	return grant.generateNewAuthorizationCode(x, redirectURI, codeChallenge, codeChallengeMethod) | ||||
| } | ||||
| @@ -567,6 +567,19 @@ func (token *OAuth2Token) SignToken() (string, error) { | ||||
| type OIDCToken struct { | ||||
| 	jwt.StandardClaims | ||||
| 	Nonce string `json:"nonce,omitempty"` | ||||
|  | ||||
| 	// Scope profile | ||||
| 	Name              string             `json:"name,omitempty"` | ||||
| 	PreferredUsername string             `json:"preferred_username,omitempty"` | ||||
| 	Profile           string             `json:"profile,omitempty"` | ||||
| 	Picture           string             `json:"picture,omitempty"` | ||||
| 	Website           string             `json:"website,omitempty"` | ||||
| 	Locale            string             `json:"locale,omitempty"` | ||||
| 	UpdatedAt         timeutil.TimeStamp `json:"updated_at,omitempty"` | ||||
|  | ||||
| 	// Scope email | ||||
| 	Email         string `json:"email,omitempty"` | ||||
| 	EmailVerified bool   `json:"email_verified,omitempty"` | ||||
| } | ||||
|  | ||||
| // SignToken signs an id_token with the (symmetric) client secret key | ||||
|   | ||||
		Reference in New Issue
	
	Block a user