# User info

Returns the identity claims of the authenticated user based on the scopes granted during authorisation.
The response includes standard OpenID Connect claims such as name, email, phone number, and address, as well as the user's Class profile which contains their business-level role and business details.
The claims returned depend on the scopes requested during the OAuth authorisation flow:
- `openid` — returns the `sub` (subject identifier).
- `profile` — returns `name`, `given_name`, `family_name`, `middle_name`, and `gender`.
- `email` — returns `email`.
- `phone` — returns `phone_number`.
- `address` — returns the `address` object.
- `class_profile` — returns the `class_profile` object containing the user's Class role and business details.

Endpoint: GET /u/connect/userinfo
Version: 1.0
Security: Class_oAuth

## Response 200 fields (application/json):

  - `sub` (string)
    The unique subject identifier for the user.
    Example: 007e9c1e-1be8-408b-b538-866cad6d3d09

  - `email` (string)
    The user's email address. Returned when the `email` scope is granted.
    Example: test.user@class.com.au

  - `name` (string)
    The user's full display name including title.
    Example: Mr Test User

  - `given_name` (string)
    The user's first name.
    Example: Test

  - `family_name` (string)
    The user's last name.
    Example: User

  - `middle_name` (string)
    The user's middle name.
    Example: Test

  - `gender` (string)
    The user's gender.
    Example: male

  - `phone_number` (string)
    The user's phone number. Returned when the `phone` scope is granted.
    Example: 0292783354

  - `address` (object)
    The user's physical address. Returned when the `address` scope is granted.

  - `address.street_address` (string)
    The street address including street number and name.
    Example: 238 Pitt Street

  - `address.locality` (string)
    The city or suburb.
    Example: Sydney

  - `address.region` (string)
    The state or territory.
    Example: NSW

  - `address.postal_code` (string)
    The postal code.
    Example: 2000

  - `address.country` (string)
    The ISO country code.
    Example: au

  - `class_profile` (object)
    The user's Class-specific profile information including their business role and business details. Returned when the `class_profile` scope is granted.

  - `class_profile.class_role` (string)
    The user's role within the Class business (e.g. Access Controller, Fund Administrator, Fund Auditor).
    Example: Access Controller

  - `class_profile.business_name` (string)
    The name of the business the user belongs to.
    Example: Sample Business

  - `class_profile.business_code` (string)
    The unique code identifying the business in Class.
    Example: BUSINESS

  - `class_profile.business_phone_number` (string)
    The phone number of the business.
    Example: 0292783354

## Response 401 fields (application/json):

  - `Errors` (array)
    A list of authorization errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: UNAUTHORIZED

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: The access token is missing, expired, or invalid.

## Response 403 fields (application/json):

  - `Errors` (array)
    A list of forbidden access errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: FORBIDDEN

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: The authenticated user does not have access to this resource.

## Response 500 fields (application/json):

  - `Errors` (array)
    A list of internal server errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: INTERNAL_ERROR

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: An unexpected error occurred. Please try again later.

## Response default fields (application/json):

  - `Errors` (array)
    A list of unexpected errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: INTERNAL_ERROR

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: An unexpected error occurred. Please try again later.

