# Implementation

When we created the OAuth connection, we made every effort to follow version 2.0 as closely as possible. You will need to complete the following three steps:

1\) **Redirect**: When the user clicks on "Login With EdgeTag," you should generate a URL that directs them to EdgeTag.

2\) **Exchange Code for Token**: After the user is redirected back, take the code provided in the URL and exchange it for access and refresh tokens.

3\) **Refresh Token**: The access token expires every 2 hours, so before it expires, you need to call the token endpoint to obtain a new access token using the refresh token.

### Enviourments

We have two environments that you can use. We suggest that you start with the sandbox and then move it to production.

#### **Sandbox**:&#x20;

**UI**: <https://app-sandbox.edgetag.io>

**API**: <https://api-sandbox.edgetag.io>

#### **Production**:&#x20;

**UI**: <https://app.edgetag.io>

**API**: <https://api.edgetag.io>

Now, let’s dive in and learn how to generate the redirect URL.

{% content-ref url="implementation/creating-redirect" %}
[creating-redirect](https://docs.edgetag.io/api/getting-started/oauth-2.0/implementation/creating-redirect)
{% endcontent-ref %}
