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 Mar 11, 2020
go.mod Outdated Show resolved Hide resolved
Loading
pages/login.tmpl Show resolved Hide resolved
Loading
oauth.go Outdated Show resolved Hide resolved
Loading
oauth.go Outdated Show resolved Hide resolved
Loading
oauth.go Outdated Show resolved Hide resolved
Loading
@paddatrapper paddatrapper changed the title [WIP] Add Gitlab OAuth Add Gitlab OAuth Mar 12, 2020
@paddatrapper
Copy link
Contributor Author

@paddatrapper paddatrapper commented Mar 12, 2020

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

Loading

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

@thebaer 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?

Loading

@paddatrapper
Copy link
Contributor Author

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

Loading

@thebaer
Copy link
Member

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

Loading

@ngerakines
Copy link
Collaborator

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

Loading

@paddatrapper
Copy link
Contributor Author

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

Loading

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

@thebaer thebaer left a comment

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

Loading

@paddatrapper
Copy link
Contributor Author

@paddatrapper paddatrapper commented Mar 16, 2020

Fixed

Loading

@thebaer
Copy link
Member

@thebaer thebaer commented Mar 16, 2020

Thanks @paddatrapper and @ngerakines! Merging now.

Loading

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

Successfully merging this pull request may close these issues.

None yet

3 participants