Skip to content

Add Gitlab OAuth - #277

Merged
thebaer merged 2 commits into
writefreely:developfrom
paddatrapper:oauth-gitlab
Mar 16, 2020
Merged

Add Gitlab OAuth#277
thebaer merged 2 commits into
writefreely:developfrom
paddatrapper:oauth-gitlab

Conversation

@paddatrapper

@paddatrapper paddatrapper commented Mar 11, 2020

Copy link
Copy Markdown
Contributor

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
Comment thread go.mod Outdated
Comment thread pages/login.tmpl
Comment thread oauth.go Outdated
Comment thread oauth.go Outdated
Comment thread oauth.go Outdated
@paddatrapper paddatrapper changed the title [WIP] Add Gitlab OAuth Add Gitlab OAuth Mar 12, 2020
@paddatrapper

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

thebaer commented Mar 12, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
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

thebaer commented Mar 13, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Comment thread config/config.go Outdated
Comment thread config/config.go Outdated

@thebaer thebaer left a comment

Copy link
Copy Markdown
Member

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

Fixed

@thebaer

thebaer commented Mar 16, 2020

Copy link
Copy Markdown
Member

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.

3 participants