**Source URL:** https://limited.veevavault.dev/commercial/vault-api/api-reference/18.3/authentication/authentication-type-discovery.md

# Authentication Type Discovery



Discover the authentication type of a user. With this API, applications can dynamically adjust the the login requirements per user, and support either username/password or OAuth2.0 / OpenID Connect authentication schemes.

<Endpoint path="https://login.veevavault.com/auth/discovery" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Accept` | `application/json` (default) |
</FieldTable>

## Query Parameters {#query-parameters}

<FieldTable>
| Name | Description |
| --- | --- |
| `username` | The user’s Vault user name. |
</FieldTable>

## Request {#request}

<CodeExample title="">
```
curl -X POST \
-H "Accept: application/json" \
https://login.veevavault.com/auth/discovery?username=meganmurray@veepharm.com

```
</CodeExample>

## Response : Password User {#response--password-user}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "errors": [],
    "data": {
        "auth_type": "password"
    }
}

```
</CodeExample>

## Response : SSO User {#response--sso-user}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "data": {
        "auth_type": "sso",
        "auth_profiles": [
            {
                "id": "_9ad0a091-cbd6-4z59-ab5a-d4f35789918c",
                "label": "VeePharm",
                "description": "",
                "vault_session_endpoint": "https://veepharm.com/auth/oauth/session/_9ad0a091-cbd6-4z59-ab5a-d4f35789918c",
                "use_adal": false,
                "as_metadata": {
                    "issuer": "https://veevaintrospection.com/oauth2/asdf123",
                    "authorization_endpoint": "https://veevintrospection.com/oauth2/asdf123/v1/authorize",
                    "token_endpoint": "https://veevaintrospection.com/oauth2/asdf123/v1/token",
                    "registration_endpoint": "https://veevaintrospection.com/oauth2/v1/clients",
                    "jwks_uri": "https://veevaintrospection.com/oauth2/asdf123/v1/keys",
                    "response_types_supported": [
                        "code",
                        "token",
                        "code token"
                    ],
                    "response_modes_supported": [
                        "query"
                    ],
                    "introspection_endpoint": "https://veevatintrospection.com/oauth2/asdf1234/v1/introspect",
                    "introspection_endpoint_auth_methods_supported": [
                        "client_secret_basic",
                    ],
                    "revocation_endpoint": "https://veevaintrospection.com/oauth2/asdf123/v1/revoke",
                    "revocation_endpoint_auth_methods_supported": [
                        "client_secret_basic",
                    ],
                    "end_session_endpoint": "https://veevaintrospection.com/oauth2/asdf123/v1/logout"
                }
            }
        ]
    }
}

```
</CodeExample>

## Response Details {#response-details}

The response specifies the user’s authentication type (`auth_type`):

* `password`: The user is configured with a username and password.

* `sso`: The user is configured with an SSO Security Policy and at least one SSO profile.

If the user’s authentication type is `sso`, the response specifies the user’s authentication profiles (`auth_profiles`). If the user’s Security Policy is associated with:

* An OAuth 2.0 / OpenID Connect profile, the response will also contain the Authentication Server metadata (`as_metadata`).

* A SAML profile, the `auth_profiles` array will be empty.

If the Authorization Server Provider is set to use ADFS, the `use_adal` field will appear in the response as `true`. If the Authorization Server Provider is set to anything else, this field is `false`.



---

**Previous:** [Retrieve API Versions](/commercial/vault-api/api-reference/18.3/authentication/retrieve-api-versions)  
**Next:** [Salesforce Delegated Requests](/commercial/vault-api/api-reference/18.3/authentication/salesforcetrade-delegated-requests)