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 login failed: No profile #410

Closed
chain710 opened this issue Sep 23, 2024 · 10 comments
Closed

OAuth login failed: No profile #410

chain710 opened this issue Sep 23, 2024 · 10 comments
Labels
feature request New feature or request

Comments

@chain710
Copy link

image

My oauth provider: authelia 4.38.12

  • click Sign in with authelia redirect to authelia sso page
  • click accept redirect back to hoarder login page, but got error OAuth login failed: No profile

my authelia instance works well with other self-host services like linkwarden and immich

found no useful log via docker logs hoarder

....

2024-09-23T14:47:13.944Z info: Workers version: 0.17.0
2024-09-23T14:47:13.954Z info: [Crawler] Connecting to existing browser instance: http://chrome:9222
(node:121) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
2024-09-23T14:47:13.960Z info: [Crawler] Successfully resolved IP address, new address: http://172.20.0.29:9222/
2024-09-23T14:47:15.981Z info: Starting crawler worker ...
2024-09-23T14:47:15.981Z info: Starting inference worker ...
2024-09-23T14:47:15.981Z info: Starting search indexing worker ...

env

REDIS_HOST=redis
REDIS_DB_IDX=15
DATA_DIR=/data
NEXTAUTH_SECRET=secret
BROWSER_WEB_URL=http://chrome:9222
MEILI_ADDR=http://meilisearch:7700
MEILI_NO_ANALYTICS=true
MEILI_MASTER_KEY=key
OPENAI_API_KEY=key
INFERENCE_IMAGE_MODEL=gpt-4o-mini
INFERENCE_TEXT_MODEL=gpt-4o-mini
OAUTH_WELLKNOWN_URL=https://auth.example.com/.well-known/openid-configuration
OAUTH_CLIENT_SECRET=secret
OAUTH_CLIENT_ID=hoarder
OAUTH_PROVIDER_NAME=authelia
NEXTAUTH_URL=https://h.example.com
@kamtschatka
Copy link
Collaborator

this happens, when authelia does not provide an email address or a name for the user you are using: https://github.com/hoarder-app/hoarder/blob/main/apps/web/server/auth.ts#L150

you'll have to check on authelia side to fill those in.

@MohamedBassem
Copy link
Collaborator

@kamtschatka I think we should probably remove the name restriction. If it's empty, we can just use the email and not fail the login on it.

kamtschatka added a commit to kamtschatka/hoarder-app that referenced this issue Sep 23, 2024
using email address as fallback, if the name is not available
@kamtschatka kamtschatka added the feature request New feature or request label Sep 23, 2024
MohamedBassem pushed a commit that referenced this issue Sep 23, 2024
…412)

using email address as fallback, if the name is not available
@chain710
Copy link
Author

this happens, when authelia does not provide an email address or a name for the user you are using: https://github.com/hoarder-app/hoarder/blob/main/apps/web/server/auth.ts#L150

you'll have to check on authelia side to fill those in.

You're right! I double-checked my Authelia configuration and discovered that the display name attribute was missing.

Thank you for your awesome work!

@mirisbowring
Copy link

Hi, I just tried to install hoarder today and wanted to connect it to my authentik install.
I experience the same behavior like OP.

I first tried release (which points to 17.1) and also latest but none of them fixed the issue.

Side Note: all fields in my OIDC Profile are set. There is a name, a username, an email, etc. so in theory this should work independent of the fix from above, no? :)

Thank you very much!

@MohamedBassem
Copy link
Collaborator

@mirisbowring what kind of error did you get? No profile as well?

@mirisbowring
Copy link

Yep:
image

@MohamedBassem
Copy link
Collaborator

@mirisbowring yeah, that's weird indeed. Did you by any chance change the OAUTH_SCOPE value?

@mirisbowring
Copy link

mirisbowring commented Oct 5, 2024

I've just set it to the defaults:

OAUTH_SCOPE="openid email profile"

Also commented this line out and still the same behaviour 😊

@mirisbowring
Copy link

image
I also checked the available fields resulting from https://auth.domain.tld/application/o/userinfo/

@mirisbowring
Copy link

Hi, since this issue persists, can we reopen this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants