> For the complete documentation index, see [llms.txt](https://docs.novacura.com/extensibility-and-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/rest-connector/how-to-guides/authenticate/oauth2.md).

# OAUTH2

How to authenticate in different ways

## OAUTH2 - as Operation inside the Project&#x20;

To learn more about Oauth2 and Authentication around REST, the Postman help section gives a good in depth look. It can be found at:  <https://learning.postman.com/docs/sending-requests/authorization/>

In Flow the connection can either be set up as it's own connector (External Oauth2 provider), or  set it up within the Rest-project itself. This is an example with Flow set up against Salesforce with 5 input parameters (string). The response is captured under the OK response.

![](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2FE13tMcEjezoLDqmLE9I1%2Fimage.png?alt=media\&token=d67dac36-104b-40b3-a4f0-3ed912a3e62e)

Note that the parameters are as FormData type

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2FbVzcl4NUOhSoQ55XBHtH%2Fimage.png?alt=media&amp;token=acf74530-76e6-4f5f-a762-2ba027c09f7d" alt="FormData"></div>

If the input body in Postman is of type x-www-form-urlencoded:

<div align="left"><img src="https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2FJhiVIqmVLiCxUEvPmw5u%2Fimage.png?alt=media&amp;token=686105bd-05b0-4dcd-a875-99c63dccb536" alt=""></div>

you will have to change the content typ to application/x-www-form-urlencoded

![setting content type to application/x-www-form-urlencoded](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2Fz1Za83ZWe7KF22mHjxmN%2Fimage.png?alt=media\&token=1997bd35-9728-4bf1-867d-a00503aa5a1d)

## OAuth2- using the specific Connector

If you choose to set up the authentication with the Oauth2-connector it may look like this which is an example of a connection with Microsoft Office 365

![](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2F2snjg7Kfj8jE02GXWyYu%2Fimage.png?alt=media\&token=4a869eb5-9063-4710-8cac-e8697e9fed47)![](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2FG8fKnirHxeyafrkmGsIl%2Fimage.png?alt=media\&token=cd4f0da0-58aa-4782-8b9d-7e8c9c7d5ecd)

In the O365 case the token has to start with "Bearer", easily obtained like this:&#x20;

![](https://3010335096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjcNODv1kQRDGTj76t9%2Fuploads%2FqISuoCpPixSrfdwz3ss5%2Fimage.png?alt=media\&token=3ca02b77-1159-4767-9417-cd798b5c1b8d)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.novacura.com/extensibility-and-integration/products/studio/connectors/rest-connector/how-to-guides/authenticate/oauth2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
