# OAuth2

OAuth2 authentication is a more secure and complex authentication method that allows users to grant limited access to their resources without exposing their credentials.

{% hint style="info" %}

* Only users with **admin** or **owner** levels (roles) have access to the OAuth2 page in Settings
  {% endhint %}

|                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                          |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| OAuth 2 login URL  | Read only input field which providing a link to Hub OAuth2 login page and could be used on external website.                                                                                                                                                                                                                                                                                                                                                                                                                |                          |
| Service Name       | Input field to add name of the service which will appears on *OAuth2 login page.*                                                                                                                                                                                                                                                                                                                                                                                                                                           |                          |
| Communication Type | <p>Section where the communication type can be selected to define how the Hub will interact (sending session data) with an external section.<br><br>There are two options: <br></p><ul><li><strong>Post message</strong> - a common way for OAuth2 login when data is sent by <code>window\.opener.postMessage(JSON.stringify(data))</code></li><li><strong>Redirect</strong> - communication type to send session\_uuid in URL via redirect <em>(e.g. <https://redirect.com/oauth2/success?session_uuid=…>)</em></li></ul> |                          |
| Example            | <p>Section to simplify integration</p><ul><li>Code block content is different based on selected <em>Communication type (Post message                                                                                                                                                                                                                                                                                                                                                                                        | Redirect)</em></li></ul> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scaleflex.com/vxp-visual-experience-platform/settings/project/access/oauth2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
