Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identity: Allow admins to specify OIDC client_id field #8165

Merged
merged 3 commits into from
Feb 14, 2020
Merged
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions vault/identity_store_oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ func oidcPaths(i *IdentityStore) []*framework.Path {
Description: "TTL of the tokens generated against the role.",
Default: "24h",
},
"client_id": {
Type: framework.TypeString,
Description: "Optional client_id",
},
},
Callbacks: map[logical.Operation]framework.OperationFunc{
logical.UpdateOperation: i.pathOIDCCreateUpdateRole,
Expand Down Expand Up @@ -931,6 +935,10 @@ func (i *IdentityStore) pathOIDCCreateUpdateRole(ctx context.Context, req *logic
role.TokenTTL = time.Duration(d.Get("ttl").(int)) * time.Second
}

if clientID, ok := d.GetOk("client_id"); ok {
role.ClientID = clientID.(string)
}

// create role path
if role.ClientID == "" {
clientID, err := base62.Random(26)
Expand Down