gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

OAuth login for username and password not working

Open UmairYasin opened this issue 4 years ago • 3 comments

Gitlab Oauth login with username and password is not working as Gitlab API for username and password is updated to must-have client ID and secret as well.

Existing implementation for the method oauth2Login needs to be updated to include client Id and Secret along with username and password

UmairYasin avatar Mar 26 '21 13:03 UmairYasin

Hello @UmairYasin can you point me to the right documentation about this change?

About the OAuth login for username and password not working. Which method did you use? I tried GitLabApi oauth2Login(String url, String username, char[] password) against gitlab.com and I can connect properly

Can you provide me a sample of code?

jabby avatar Mar 26 '21 17:03 jabby

@jabby - Please have a look at the this documentation.

Also this looks to me an issue with 13.9 version because in the documentation for 13.10, clientId and secret are optional now.

I am using following GitlabApi method

oauth2Login(String url, String username, CharSequence password)

UmairYasin avatar Mar 28 '21 20:03 UmairYasin

Have a look at this GitLab Issue and discussion. GitLab made a breaking change in 13.9, which was resolved in 13.10. However, there is a good chance that the resource owner password credentials flow will be disabled again at some point in the future. It would be cool if gitlab4j-api could provide some kind of support for the regular OAuth flow in future (if there is an app in GitLab, getting a URL to redirect the user to for authentication, etc.).

maltem-za avatar Apr 07 '21 09:04 maltem-za