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

Could not authenticate you from [My Provider name] because "Unknown" #171

Open
habin201291 opened this issue Jan 3, 2024 · 3 comments
Open

Comments

@habin201291
Copy link

habin201291 commented Jan 3, 2024

Hi!

I am using doorkeeper-openid_connect gem as an OIDC provider.

When I clicked on the Login button at the client and got an error below:
Could not authenticate you from Docerfy because "Unknown".
Docerfy is name of OIDC provider.

My configurations in Devise.rb file below:
config.omniauth :openid_connect, {
name: :docerfy,
issuer: "https://774e-117-3-70-40.ngrok-free.app/",
scope: [:openid, :email],
response_type: :code,
uid_field: "preferred_username",
require_state: false,
client_options: {
port: 443,
scheme: "https",
host: "774e-117-3-70-40.ngrok-free.app",
authorization_endpoint: "/oauth/authorize",
token_endpoint: "/oauth/token",
identifier: "BYUfnhIsbHuRb5Fs638WZdQZCGhEboVREiL3yAtthQw",
secret: "nsccbh5P3y3ovKOEVUBsw23HW-mt0gtJfQFdBl_AOwA",
redirect_uri: "https://a683-117-3-70-40.ngrok-free.app/users/auth/docerfy/callback",
},
}

I am quite confused because I do not know if the error lies in these gems or from somewhere else.

Hope this help!

@davidwessman
Copy link
Contributor

I would recommend using discovery: true if possible, helped me with a lot of issues.
But only if your provider supports discovery.

@habin201291
Copy link
Author

habin201291 commented Jan 8, 2024

I would recommend using discovery: true if possible, helped me with a lot of issues. But only if your provider supports discovery.

It seems to be working, thank you very much, but I have another problem. The OIDC client returned the following error:
Undefined method with_indifferent_access for "<a href=\"https://3e90-117-3-70-40.ngrok-free.app/oauth/discovery/keys\">temporary redirect</a>.\n\n":string

And the link above shows a json like: {"keys":[{"kty":"RSA","n":"wVRCGZ4KEqa1OwECAhupl0KoaPd8nYFi94IsjdcRrZkYG_s7a248s5r1mw_OBE5OIvkVFUCOIY_vXQcx-KFawTFrWhOvIffSqy6i7pMRDGB78J-teW5XvbtB4nhSy3wWtuYi9cIlbcFT2n3pJLCKLj_wss_MWkBTZpZtB2ynqe6MgjZevkbLIAEGroMYlrTX2ijFcrJYKO7mJMWfzO8_lKeu2tG9IKL-epC-72oMpCP95cs8_e7xSlI7VBX5nsl_8490oom2ISu5mK-aWIppvgQlRoG4_61EI50P53pr3xJTle3M1BpV-AFOlKLHZmME_g3bjhlIXcU6mcL9kYd56w","e":"AQAB","kid":"dtXls8aranECkXUaG8BBFsOZJVAbys7hLQnqGp1Qv0I","use":"sig","alg":"RS256"}]}

@davidwessman
Copy link
Contributor

Does your IDP-provider support the .well-known/openid-configuration endpoint?
For example: https://accounts.google.com/.well-known/openid-configuration

Seems like some ruby-gem expects an array and not another link

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

No branches or pull requests

2 participants