-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
bug: unable to call the user info endpoint when integrating Logto Cloud with rust openidconnect. #6589
Comments
Coud you please provider a sample project to reproduce this issue? Or full error messages of the response, and your OIDC configurations. |
pub async fn get_user_by_token(&self, token: String) -> Result<(user::Model, CoreUserInfoClaims), Error> {
let access_token = AccessToken::new(token);
let user_info_claims: CoreUserInfoClaims = self.client.user_info(access_token, None)?
.request_async(async_http_client)
.await?;
let sub = user_info_claims.subject().as_str();
let user = self.get_or_create_user(sub).await?;
Ok((user, user_info_claims))
} Here is a simple code snippet that demonstrates a straightforward method using the standard CoreClient and CoreUserInfoClaims provided by openidconnect. My application is quite large, so it’s difficult for me to extract a complete application. You can use any SPA application (I am using React and @logto/react) to log in via the OIDC service provided by Logto Cloud, obtain the Access Token, and pass it to the Rust backend. Then use this Access Token, request the |
I'll take a look soon. |
It seems that Logto does not omit null values, and the returned updated_at and created_at are unix timestamp milliseconds not seconds, which is not in compliance with the standard. |
hi @AH-dark, thanks for your detailed information, there are two things to do:
However, this will cause a breaking change, so let's hold for now, need to discuss with the team. |
Describe the bug
Based on the response in this GitHub issue, I suspect that the OIDC content provided by Logto may not fully comply with the standard.
When calling the userinfo endpoint with the openidconnect library, a parsing error occurred. This might suggest an issue with how the user information is being returned or formatted, potentially due to a deviation from the expected OpenID Connect standard in the response from Logto.
Expected behavior
This API should return a 200 status code along with JSON content compliant with the OIDC standard.
How to reproduce?
Retrieve user info using Rust’s openidconnect 3.5.0 and Logto Cloud.
Context
The text was updated successfully, but these errors were encountered: