No access via accessToken to self hosted GitLab (CE, EE)

Hi there!

I’m unable to add GitLab credentials for self-hosted environments. I’ve tried with the community edition and the enterprise edition. Other tools are working fine with these environments via accessToken (e.g. CLI, Raycast, …), so I think it has something to do with n8n but I have no clue what happens here.

When I try to save the credentials I get this error message:

@Jon : If you want to debug it, please let me know. I can share an access token for the community edition as well as the server url with you in private (maybe via Discord).

Best,
Sven

@svzi go on then fire over the URL and the key and I will take a look :slight_smile:

@Jon Thanks for your great support, I really appreciate it. :+1:

I want to note here, that my GitLab tokens (CE and EE) worked perfectly, but the credentials check of the GitLab node is doing wrong, as it’s checking the /users endpoint. But that endpoint is used for listing all users of an instance and requires the api scope. So if the token has no scope for api the credentials test will fail.

A better approach to checking the credentials, without needing any special scope for it, is the endpoint /personal_access_tokens/self which shows everything related to the currently used accessToken (e.g. the scopes and expiration date).

I’ve just created a PR to fix it:

Best,
Sven

2 Likes

Great thanks a lot @svzi for not just sharing what the problem was but also directly fixing it in the code!

2 Likes

You’re welcome @jan ! I think that’s what open source all about. :slight_smile: Luckily I have the abilities to fix this myself, so I do and try to give just a tiny bit back to the community (and the creators/maintainers).

3 Likes

Got released with [email protected]

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.