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

OpenShift custom OAuth support #13925

Merged
merged 6 commits into from
Apr 7, 2019
Merged

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
Member

@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
Member

@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.

None yet

3 participants