pub async fn fetch_userinfo(
http_service: &BoxCloneSyncService<Request<Bytes>, Response<Bytes>, Box<dyn Error + Send + Sync>>,
userinfo_endpoint: &Url,
access_token: &str,
jwt_verification_data: Option<JwtVerificationData<'_>>,
auth_id_token: &Jwt<'_, HashMap<String, Value>>,
) -> Result<HashMap<String, Value>, UserInfoError>
Available on crate feature
experimental-oidc
only.Expand description
Obtain information about an authenticated end-user.
Returns a map of claims with their value, that should be extracted with
one of the Claim
methods.
§Arguments
-
http_service
- The service to use for making HTTP requests. -
userinfo_endpoint
- The URL of the issuer’s User Info endpoint. -
access_token
- The access token of the end-user. -
jwt_verification_data
- The data required to verify the response if a signed response was requested during client registration.The signing algorithm corresponds to the
userinfo_signed_response_alg
field in the client metadata. -
auth_id_token
- The ID token that was returned from the latest authorization request.
§Errors
Returns an error if the request fails, the response is invalid or the validation of the signed response fails.