# Get OAuth settings

- Operation ID: `getOauthSettingsUsingGET`
- HTTP method: `GET`
- Path: `/sauth/settings/oauth`
- [Human-readable API reference](https://hub.synerise.com/api-reference/identity-and-access-management#tag/Settings/operation/getOauthSettingsUsingGET)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /sauth/settings/oauth:
    get:
      tags:
        - Settings
      summary: Get OAuth settings
      description: |
        Retrieve OAuth authentication settings

        ---

        **API consumer:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **User role permission required:** `settings_customers_iam_oauth: read`
      operationId: getOauthSettingsUsingGET
      security:
        - JWT: []
      responses:
        "200":
          description: Current settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
                  mode:
                    type: string
                    enum:
                      - JWT_TOKEN
                      - SERVER
                    description: |
                      The mode of authentication:

                      - SERVER: Your OAuth server returns a token to the client device; the client device passes it to the Synerise backend; Synerise backend verifies the token with your OAuth backend
                      - JWT_TOKEN: Your OAuth server returns a JWT to the client device; the client device passes it to the Synerise backend; the Synerise backends verifies it with the provided JWK. This mode requires fewer resources from your backend.
                  endpoint:
                    type: string
                    description: |
                      URL of the OAuth authorization endpoint when the `SERVER` mode is selected.  
                      If you want to pass the token from your backend in the URL, use the `{{_snrs_access_token}}` insert.
                  jwkEndpoint:
                    type: string
                    description: |
                      URL of the JWK when the `JWT_TOKEN` mode is selected.  
                      If you want to pass the token from your backend in the URL, use the `{{_snrs_access_token}}` insert.
                  headers:
                    type: object
                    description: |
                      'Headers for the authorization request when `SERVER` mode is selected. For example, `"X-Custom-Header": "someValue"`  
                      If you want to pass the token from your backend in a header, use the `{{_snrs_access_token}}` insert'
                    example:
                      Content-Type: application/json
                      Authorization: Bearer {{_snrs_access_token}}
                      Cache-control: no-cache
                    additionalProperties:
                      type: string
                  mapping:
                    type: object
                    description: 'A mapping of fields from the Synerise endpoint to your OAuth endpoint. For example, if your field is called `token` and its counterpart in Synerise is `accessToken`, the mapping is `"accessToken": "token"`'
                    additionalProperties:
                      type: string
                  name:
                    type: string
                    description: Name of the integration
                  mappedExternal:
                    type: boolean
                    default: true
                    description: If set to FALSE, the authentication request must include the customer's `customId` in the body.
                  syncDataOnLogin:
                    type: boolean
                    default: false
                    description: When set to TRUE, profile data from an external authentication provider is uploaded into the Synerise database every time the profile logs in. When FALSE, the data is saved only the first time a profile logs in, so that the amount of data is reduced in later authentication requests.
                  validation:
                    type: object
                    description: A validation mapping of fields from jwt token.
                    additionalProperties:
                      type: string
        "401":
          description: JWT missing, expired, or invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Description of the problem
                  errors:
                    type: array
                    description: An array of detailed error messages, if applicable
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                          description: Error code
                        field:
                          type: string
                          description: Name of the field that did not pass validation
                        message:
                          type: string
                          description: Details of the problem
                        rejectedValue:
                          description: The value that did not pass validation
                          anyOf:
                            - type: string
                            - type: number
                            - type: integer
                            - type: boolean
                            - type: array
                              items: {}
                            - type: object
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  path:
                    type: string
                    description: URL of the requested resource
                  traceId:
                    type: string
                    description: ID for debugging
        "403":
          description: Insufficient permissions or wrong JWT scope (for example, profile token where a workspace token was required)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Summary of the error
                  message:
                    type: string
                    description: Description of the problem
                  errors:
                    type: array
                    description: An array of detailed error messages, if applicable
                    items:
                      type: object
                      properties:
                        code:
                          type: integer
                          description: Error code
                        field:
                          type: string
                          description: Name of the field that did not pass validation
                        message:
                          type: string
                          description: Details of the problem
                        rejectedValue:
                          description: The value that did not pass validation
                          anyOf:
                            - type: string
                            - type: number
                            - type: integer
                            - type: boolean
                            - type: array
                              items: {}
                            - type: object
                  status:
                    type: integer
                    format: int32
                    description: Status code
                  timestamp:
                    type: string
                    description: Time when the message was sent
                  path:
                    type: string
                    description: URL of the requested resource
                  traceId:
                    type: string
                    description: ID for debugging
        "404":
          description: Not Found
          content: {}
      x-snr-doc-urls:
        - /api-reference/identity-and-access-management#tag/Settings/operation/getOauthSettingsUsingGET
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/sauth/settings/oauth \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/sauth/settings/oauth", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/sauth/settings/oauth");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/sauth/settings/oauth",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/sauth/settings/oauth');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/sauth/settings/oauth")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Settings
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
