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

feat: GitHub OAuth authentication with embededOAuthAPI #178

Merged
merged 7 commits into from
Dec 8, 2021

Conversation

xbaran4
Copy link
Contributor

@xbaran4 xbaran4 commented Nov 10, 2021

Signed-off-by: xbaran4 pbaran@redhat.com

What does this PR do?

Screenshot/screencast of this PR

Enables OAuth flow for GitHub without Keycloak. Using embededOAuthAPI

What issues does this PR fix or reference?

eclipse-che/che#20497

How to test this PR?

1.Deploy quay.io/pbaran/che-server:github10 with devworkspaces.
2. Create GitHub OAuth App in your account. (https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app)
2.1 Application name => Che (But should not matter)
2.2 Homepage URL => $CHE_HOST
2.3 Authorization callback URL => $CHE_HOST/api/oauth/callback
2.4 Register application and generate a new client secret
3. Use your client id and client secret to create k8s github-oauth-config secret:

kubectl apply -f - <<EOF
kind: Secret
apiVersion: v1
metadata:
  name: github-oauth-config
  namespace: <Che namespace. Default eclipse-che> 
  labels:
    app.kubernetes.io/part-of: che.eclipse.org
    app.kubernetes.io/component: oauth-scm-configuration
  annotations:
    che.eclipse.org/oauth-scm-server: github
type: Opaque
data:
  id: <...> 
  secret: <...> 
EOF

(https://www.eclipse.org/che/docs/che-7/administration-guide/configuring-authorization/#configuring-github-oauth_che)
4. Right now you have to restart che-server pod to have the credentials mounted in che.
5. Try to create factory from private repo on your github.

Note: right now you have to have older dashboard version i.e. 7.39.2 because of a bug: eclipse-che/che#20835

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@che-bot
Copy link
Contributor

che-bot commented Nov 10, 2021

Can one of the admins verify this patch?

@xbaran4 xbaran4 changed the title fix: adapting requests to new github api feat: GitHub OAuth authentication with embededOAuthAPI Nov 24, 2021
Signed-off-by: Pavol Baran <pbaran@redhat.com>
Signed-off-by: Pavol Baran <pbaran@redhat.com>
Signed-off-by: Pavol Baran <pbaran@redhat.com>
Signed-off-by: Pavol Baran <pbaran@redhat.com>
Signed-off-by: Pavol Baran <pbaran@redhat.com>
Signed-off-by: Pavol Baran <pbaran@redhat.com>
Copy link
Contributor

@skabashnyuk skabashnyuk left a comment

Choose a reason for hiding this comment

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

Works for me
Знімок екрана 2021-11-30 о 11 59 29
Знімок екрана 2021-11-30 о 11 59 50
Знімок екрана 2021-11-30 о 12 05 48

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.

4 participants