Skip to content

OpenShift custom OAuth support#13925

Merged
engelgabriel merged 6 commits intoRocketChat:developfrom
bsharrow:develop
Apr 7, 2019
Merged

OpenShift custom OAuth support#13925
engelgabriel merged 6 commits intoRocketChat:developfrom
bsharrow:develop

Conversation

@bsharrow
Copy link
Contributor

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

When adding OpenShift as a custom OAuth provider, the following error message is output:

Exception while invoking method 'login' Error: Service data for service openshift must include id

OpenShift's identity endpoint (/oapi/v1/users/~) returns the following:

{
    "kind": "User",
    "apiVersion": "v1",
    "metadata": {
        "name": "<USERNAME>",
        "selfLink": "/oapi/v1/users/<USERNAME>",
        "uid": "55c68f17-41d5-11e9-a0d2-005056a00a29",  // *this is the user ID
        "resourceVersion": "21557",
        "creationTimestamp": "2019-03-08T19:06:53Z"
    },
    "fullName": "<REDACTED>",
    "identities": [
        "LDAP:<USERNAME>"
    ],
    "groups": [
        "system:authenticated",
        "system:authenticated:oauth"
    ]
}

This fix provides compatibility with OpenShift's OAuth server.

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

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above 🔝

Also set the identity's display name based on the OpenShift user's `fullName` attribute.
Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙏

@engelgabriel engelgabriel added this to the 1.0.0 milestone Apr 7, 2019
@engelgabriel engelgabriel merged commit 338e4da into RocketChat:develop Apr 7, 2019
@rodrigok rodrigok mentioned this pull request Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments