Request

Response

    Task 2 – Fetch User Information via OIDC UserInfo API

    The OIDC UserInfo API provides access to user profile information through a REST endpoint that complies with the OpenID Connect specification. This is an alternative to the GraphQL API for accessing user profile data.

    This task retrieves user information using the OIDC-compliant /userinfo endpoint.

    Expected task outcome

    By the end of this task, you will know how to use the OIDC UserInfo API to retrieve user profile information using a simple REST GET request.

    API Endpoint used in this task

    You use the following endpoint for this task:

    NameDescription
    userinfo Get profile information of an authorizing end user in an OIDC-compliant context.

    Step 1 - Get User Information via OIDC UserInfo API

    1. Ensure you have a valid 3-legged OAuth access token from Task 1. The OIDC UserInfo endpoint requires user context and only works with 3-legged tokens.
    2. Make a GET request to the UserInfo endpoint:

      Modern APS Endpoint (Recommended): https://api.aps.autodesk.com/userinfo

      Legacy Endpoint (Still Supported): https://developer.api.autodesk.com/userinfo

      Method: GET

      Headers:

      • Authorization: Bearer <YOUR_ACCESS_TOKEN>
      • x-correlation-id: <UNIQUE_REQUEST_ID> (optional but recommended)
    3. Example request using cURL (Modern APS):

      curl --location 'https://api.aps.autodesk.com/userinfo' \
           --header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
           --header 'x-correlation-id: 123e4567-e89b-12d3-a456-426614174000'
      

      Or using the legacy endpoint:

      curl --location 'https://developer.api.autodesk.com/userinfo' \
           --header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
           --header 'x-correlation-id: 123e4567-e89b-12d3-a456-426614174000'
      
    4. The response will contain OIDC-compliant user information. A successful response should be similar to this:

      {
        "sub": "ABCDEFGH",
        "name": "First Last",
        "given_name": "First",
        "family_name": "Last",
        "preferred_username": "username",
        "email": "test@test.com",
        "email_verified": true,
        "alternate_email": "test.alternate@test.com",
        "profile": "https://profile.autodesk.com",
        "picture": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x120.jpg",
        "locale": "en-US",
        "updated_at": 1662583480,
        "is_twofa_enabled": false,
        "country_code": "US",
        "address": {
          "street_address": "testaddress1\n",
          "locality": "testcity",
          "region": "",
          "postal_code": "",
          "country": "US"
        },
        "phone_number": "+1 1234567890 #123",
        "phone_number_verified": false,
        "ldap_enabled": true,
        "ldap_domain": "autodesk.com",
        "job_title": "3D generalist",
        "industry": "IT/Software development",
        "industry_code": "NoGroupOther",
        "about_me": "I'm completing a test right now.",
        "language": "en",
        "company": "Autodesk",
        "created_date": "2017-12-11T20:54:18Z",
        "last_login_date": "2020-05-10T04:00:29Z",
        "eidm_guid": "ABCDEFGH",
        "opt_in": false,
        "social_userinfo_list": [
          {
            "socialUserId": "test.social_userid",
            "providerId": "test1.uid",
            "providerName": "Google"
          }
        ],
        "twofa_type": "Phone",
        "contact_mode": "SMS",
        "user_source_type": "Provisioned",
        "user_thumbnails": {
           "sizeX20": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x20.jpg",
           "sizeX40": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x40.jpg",
           "sizeX50": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x50.jpg",
           "sizeX58": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x58.jpg",
           "sizeX80": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x80.jpg",
           "sizeX120": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x120.jpg",
           "sizeX160": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x160.jpg",
           "sizeX176": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x176.jpg",
           "sizeX240": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x240.jpg",
           "sizeX360": "https://images.profile.autodesk.com/<USER_ID>/profilepictures/x360.jpg"
        }
      }
      
      Show More

    Key Features of OIDC UserInfo API

    • OIDC Compliant: Follows OpenID Connect specification for user information
    • REST Endpoint: Simple GET request, no GraphQL knowledge required
    • 3-Legged OAuth: Requires user context authentication
    • Rich User Data: Includes profile, contact, professional, and social information
    • Image Thumbnails: Provides multiple sizes of user profile pictures
    • Rate Limited: 500 calls per minute

    Error Handling

    If the request fails, you’ll receive an error response:

    {
      "error": "invalid_token",
      "error_description": "The access token is invalid or has expired"
    }
    

    Common error scenarios:

    • 401 Unauthorized: Invalid or expired access token
    • 403 Forbidden: Token doesn’t have required permissions
    • 429 Too Many Requests: Rate limit exceeded (500 calls/minute)

    Next Steps

    • For more detailed code examples, see the UserInfo Snippets section
    • For GraphQL-based access to user profiles, refer to Tasks 2-4
    • For advanced profile management operations, explore the mutation APIs