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

oAuth - Invalid Credentials #8378

Closed
3 tasks done
NilsBaumgartner1994 opened this issue Sep 28, 2021 · 11 comments · Fixed by #8389
Closed
3 tasks done

oAuth - Invalid Credentials #8378

NilsBaumgartner1994 opened this issue Sep 28, 2021 · 11 comments · Fixed by #8389
Labels

Comments

@NilsBaumgartner1994
Copy link
Contributor

Preflight Checklist

Describe the Bug

The last update broke the oAuth login.

On Version: 9.0.0-rc.94 everything works fine. On the latest version it throws an error: myappdirectus | 10:40:39 ⚠️ Invalid user credentials.

FAQ:

  • Yes the user is created
  • Yes the user is activated

I can reproduce the problem.

To Reproduce

Just simply create an own SSO service.
Used docker.

What version of Directus are you using?

directus/directus:9.0.0-rc.95

What version of Node.js are you using?

v14.15.4

What database are you using?

postges

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying Directus?

Docker

@mp-itconsulting
Copy link

Same problem for me. AUTH0 configured correctly but still got the reply "Invalid user credentials" and redirected to "../admin/login?reason=INVALID_USER"

Attributes are retrieved from AUTH0 but email seems not to be verified. Other apps with similar settings are working fine.
Tested also with several scope definitions: "openid email", "array:openid,email" or ["openid","email"]. But no success at all

Kr
Michael

@NilsBaumgartner1994
Copy link
Contributor Author

Same problem for me. AUTH0 configured correctly but still got the reply "Invalid user credentials" and redirected to "../admin/login?reason=INVALID_USER"

Attributes are retrieved from AUTH0 but email seems not to be verified. Other apps with similar settings are working fine. Tested also with several scope definitions: "openid email", "array:openid,email" or ["openid","email"]. But no success at all

Kr Michael

"Fixed" this problem by using version before latest --> image: directus/directus:9.0.0-rc.94

@NilsBaumgartner1994
Copy link
Contributor Author

But i can confirm, that i also have the problem with "INVALID_USER".

@mp-itconsulting
Copy link

Also downgraded to rc.94 and it´s working

@u12206050
Copy link
Contributor

I have the same issue, but downgrading to rc.94 didn't work either.

@NilsBaumgartner1994
Copy link
Contributor Author

I have the same issue, but downgrading to rc.94 didn't work either.

be sure to purge docker

@u12206050
Copy link
Contributor

Am not using docker, but have removed package-lock.json and node_modules and it still gives me INVALID_USER.
Will try rc.93

@u12206050
Copy link
Contributor

Ah nevermind, realized now in my package.json that I need to have "directus": "9.0.0-rc.94", and NOT "^directus": "9.0.0-rc.94",

@darioguarascio
Copy link

Same problem here. OAUTH is ok (tested with other software) but directus is giving INVALID_USER

@isaacnass
Copy link

@darioguarascio I struggled with this all morning myself. I have been able to monkeypatch it by adding the following to node_modules/directus/dist/services/authentication.js:58:

async login(providerName = constants_1.DEFAULT_AUTH_PROVIDER, payload, otp) {
        payload.email = payload.email || payload.identifier # <--- Added line
        var _a, _b;
        const STALL_TIME = 100;
        const timeStart = perf_hooks_1.performance.now();

As far as I can tell there is some sort of change in the way Google Oauth payloads are either returned or parsed. Since the default auth provider is used to parse the auth payload, it gets angry when there isn't an email there

@aidenfoxx
Copy link
Contributor

@darioguarascio @isaacnass There is already a fix for this that will apparently be released today #8389. As you discovered the issue was that the value identifier was being sent when email was expected.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants