Function mas_oidc_client::requests::userinfo::fetch_userinfo
source · pub async fn fetch_userinfo(
http_service: &HttpService,
userinfo_endpoint: &Url,
access_token: &str,
jwt_verification_data: Option<JwtVerificationData<'_>>,
auth_id_token: &IdToken<'_>,
) -> Result<HashMap<String, Value>, UserInfoError>
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.