Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 2.71 KB

openid-connect-userinfo.md

File metadata and controls

62 lines (43 loc) · 2.71 KB
description
This page provides the technical details of the OpenID Connect UserInfo policy

OpenID Connect UserInfo

Overview

Use the openid-userinfo policy to get the OpenId Connect user info from an OAuth2 resource through its UserInfo endpoint.

{% hint style="info" %} The request will fail with a 401 status if the policy’s Oauth2 resource is misconfigured or not defined at all. To troubleshoot this, check the WWW_Authenticate header for more information. {% endhint %}

Functional and implementation information for the openid-userinfo policy is organized into the following sections:

Examples

{% hint style="warning" %} This policy can be applied to v2 APIs and v4 proxy APIs. It cannot be applied to v4 message APIs. {% endhint %}

{% tabs %} {% tab title="Proxy API example" %} Sample policy configuration for a payload extraction flow:

{
  "name": "OpenId Connect - UserInfo",
  "description": "",
  "enabled": true,
  "policy": "policy-openid-userinfo",
  "configuration": {
    "oauthResource": "dummy-oauth-resource",
    "extractPayload": true
  }
}

{% endtab %} {% endtabs %}

Configuration

Phases

The phases checked below are supported by the openid-userinfo policy:

v2 PhasesCompatible?v4 PhasesCompatible?
onRequesttrueonRequesttrue
onResponsefalseonResponsefalse
onRequestContentfalseonMessageRequestfalse
onResponseContentfalseonMessageResponsefalse

Options

The openid-userinfo policy can be configured with the following options:

PropertyRequiredDescriptionTypeDefault
oauthResourcetrueThe OAuth2 resource used to get UserInfostring
extractPayloadfalseWhen set to true, the payload of the response from the UserInfo endpoint is set in the openid.userinfo.payload gateway attributeboolean

Changelogs

{% @github-files/github-code-block url="https://github.com/gravitee-io/gravitee-policy-OpenID-Connect-UserInfo/blob/master/CHANGELOG.md" %}