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 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 oauth-gitlab branch 2 times, most recently from 2128b86 to 1e65a63 Compare March 11, 2020 14:02
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 changed the title [WIP] Add Gitlab OAuth Add Gitlab OAuth Mar 12, 2020
@paddatrapper
Copy link
Contributor Author

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
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
Copy link
Contributor Author

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
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
Copy link
Collaborator

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
Copy link
Contributor Author

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 oauth-gitlab branch 2 times, most recently from 865805d to ba37855 Compare March 16, 2020 08:04
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
Copy link
Member

@thebaer thebaer left a comment

Choose a reason for hiding this comment

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

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

@paddatrapper
Copy link
Contributor Author

Fixed

@thebaer
Copy link
Member

thebaer commented Mar 16, 2020

Thanks @paddatrapper and @ngerakines! Merging now.

@thebaer thebaer merged commit 5b6e008 into writefreely:develop Mar 16, 2020
@paddatrapper paddatrapper deleted the oauth-gitlab branch March 16, 2020 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants