Skip to content

Commit

Permalink
OpenShift custom OAuth support (#13925)
Browse files Browse the repository at this point in the history
* OpenShift custom OAuth support

Search for "metadata.uid" field to support JSON responses from OpenShift's user API.

* Ensure full path to OpenShift user ID exists.

Also set the identity's display name based on the OpenShift user's `fullName` attribute.
  • Loading branch information
bsharrow authored and engelgabriel committed Apr 7, 2019
1 parent d7d5b66 commit 338e4da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/custom-oauth/server/custom_oauth_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ export class CustomOAuth {
identity.id = identity.sub;
}

// Fix OpenShift identities where id is in 'metadata' object
if (!identity.id && identity.metadata && identity.metadata.uid) {
identity.id = identity.metadata.uid;
identity.name = identity.fullName;
}

// Fix general 'userid' instead of 'id' from provider
if (identity.userid && !identity.id) {
identity.id = identity.userid;
Expand Down

0 comments on commit 338e4da

Please sign in to comment.