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

Add Gitlab OAuth #277

Merged
merged 2 commits into from Mar 16, 2020
Merged

Add Gitlab OAuth #277

merged 2 commits into from Mar 16, 2020

Conversation

@paddatrapper
Copy link
Contributor

paddatrapper commented Mar 11, 2020

Adds GitLab support to the OAuth authentication structure.

It is discussed here. Currently clicking on the 'Login with GitLab' button results in a 404 error.


  • I have signed the CLA
@paddatrapper paddatrapper force-pushed the paddatrapper:oauth-gitlab branch 2 times, most recently from 2128b86 to 1e65a63 Mar 11, 2020
go.mod Outdated Show resolved Hide resolved
pages/login.tmpl Show resolved Hide resolved
oauth.go Outdated Show resolved Hide resolved
oauth.go Outdated Show resolved Hide resolved
oauth.go Outdated Show resolved Hide resolved
@paddatrapper paddatrapper force-pushed the paddatrapper:oauth-gitlab branch from 1e65a63 to 5e02e89 Mar 12, 2020
@paddatrapper paddatrapper changed the title [WIP] Add Gitlab OAuth Add Gitlab OAuth Mar 12, 2020
@paddatrapper paddatrapper force-pushed the paddatrapper:oauth-gitlab branch from 173a2c8 to c292512 Mar 12, 2020
@paddatrapper paddatrapper requested a review from ngerakines Mar 12, 2020
@paddatrapper

This comment has been minimized.

Copy link
Contributor Author

paddatrapper commented Mar 12, 2020

I have fixed the issues and can now successfully log in using GitLab OAuth as the authentication method

@thebaer thebaer added this to the 0.12 milestone Mar 12, 2020
@thebaer

This comment has been minimized.

Copy link
Member

thebaer commented Mar 12, 2020

Some things I'm wondering about:

  • Should we simplify configuration so you only need to set the Gitlab instance hostname? Then the application could just append the path to the URL for each endpoint.
  • Should we make the "Sign in with Gitlab" button text configurable? I'm thinking users might want to know which Gitlab instance they'd be authenticating with.

Thoughts?

@paddatrapper

This comment has been minimized.

Copy link
Contributor Author

paddatrapper commented Mar 12, 2020

Should we simplify configuration so you only need to set the Gitlab instance hostname? Then the application could just append the path to the URL for each endpoint.

I would prefer this, but I wasn't sure if the API server could be a separate URL to the instance. Does anyone know if that is possible?

Should we make the "Sign in with Gitlab" button text configurable? I'm thinking users might want to know which Gitlab instance they'd be authenticating with.

Good idea. Will do

@thebaer

This comment has been minimized.

Copy link
Member

thebaer commented Mar 13, 2020

I would prefer this, but I wasn't sure if the API server could be a separate URL to the instance. Does anyone know if that is possible?

I'm not sure. But if we don't hear otherwise, I think we can go ahead and implement it that way now. If we pick a good name for the config field, we can always re-add the fields for specific endpoints in the future, if they turn out to be necessary.

Good idea. Will do

Awesome, sounds good. Of course, it'd probably be good to fall back to some kind of default string if there's none configured.

@ngerakines

This comment has been minimized.

Copy link
Collaborator

ngerakines commented Mar 13, 2020

There isn't any reason it can't be separate. The only consideration is making sure that we're not hardcoding any gitlab.com URLs so people with private/self-hosted instances can use it.

@paddatrapper

This comment has been minimized.

Copy link
Contributor Author

paddatrapper commented Mar 16, 2020

I'm not sure. But if we don't hear otherwise, I think we can go ahead and implement it that way now. If we pick a good name for the config field, we can always re-add the fields for specific endpoints in the future, if they turn out to be necessary.

Done

Awesome, sounds good. Of course, it'd probably be good to fall back to some kind of default string if there's none configured.

Defaults to GitLab if not configured

@paddatrapper paddatrapper force-pushed the paddatrapper:oauth-gitlab branch 2 times, most recently from 865805d to ba37855 Mar 16, 2020
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
Copy link
Member

thebaer left a comment

Just a few comments on the field names to keep things tidy. Otherwise this looks good to me!

@paddatrapper paddatrapper force-pushed the paddatrapper:oauth-gitlab branch from ba37855 to 26b6ed5 Mar 16, 2020
@paddatrapper

This comment has been minimized.

Copy link
Contributor Author

paddatrapper commented Mar 16, 2020

Fixed

@thebaer

This comment has been minimized.

Copy link
Member

thebaer commented Mar 16, 2020

Thanks @paddatrapper and @ngerakines! Merging now.

@thebaer thebaer merged commit 5b6e008 into writeas:develop Mar 16, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@paddatrapper paddatrapper deleted the paddatrapper:oauth-gitlab branch Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.