Skip to content

Add Scope value predefined in the specification (profile, email, address, phone) #385

Open
@arukiidou

Description

@arukiidou

Summary

If I open this PR, is it acceptable?

Citation of specifications

https://openid.net/specs/openid-connect-core-1_0.html

5.4.  Requesting Claims using Scope Values
profile
OPTIONAL. This scope value requests access to the End-User's default profile Claims, which are: name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo, locale, and updated_at.
email
OPTIONAL. This scope value requests access to the email and email_verified Claims.
address
OPTIONAL. This scope value requests access to the address Claim.
phone
OPTIONAL. This scope value requests access to the phone_number and phone_number_verified Claims.

Key changes.

  • Omit examples and document updates yet - if you favor this proposal, I will start.
const (
	ScopeProfile = "profile"
	ScopeEmail = "email"
	ScopeAddress = "address"
	ScopePhone = "phone"
)

Anticipated Questions

        // before
	config := oauth2.Config{
		Scopes:       []string{oidc.ScopeOpenID, "profile", "email"},
	}
        // after
	config := oauth2.Config{
		Scopes:       []string{oidc.ScopeOpenID, oidc.ScopeProfile, oidc.ScopeEmail},
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions