# Example REDIRECT\_URI please?

**URL:** <https://forum.gitea.com/t/example-redirect-uri-please/6440>\
**Category:** Install/Maintain/Configure\
**Created:** [December 23, 2022, 9:40pm UTC](https://forum.gitea.com/t/example-redirect-uri-please/6440 "2022-12-23T21:40:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blaisep](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/blaisep/32/2818_2.png) [@blaisep](https://forum.gitea.com/u/blaisep)\
**Post date:** [December 23, 2022, 9:40pm UTC](https://forum.gitea.com/t/example-redirect-uri-please/6440/1 "2022-12-23T21:40:19Z")

</div>

It would be great if the OAUTH guide provided an example of a REDIRECT\_URI, in addition to describing all the other exceptional cases.

For example in the section on [client typeS](https://docs.gitea.io/en-us/oauth2-provider/#client-types) there is only one client type described.

And in the [list of endpoints](https://docs.gitea.io/en-us/oauth2-provider/#endpoints) none of them are flagged at the REDIRECT\_URI

I’m guessing that it is either

```auto
https://[YOUR-GITEA-URL]/login/oauth/authorize
or
https://[YOUR-GITEA-URL]/

```

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [December 26, 2022, 7:23pm UTC](https://forum.gitea.com/t/example-redirect-uri-please/6440/2 "2022-12-26T19:23:15Z")

</div>

The guide you linked is for Gitea acting as the authentication provider (like how you can login to this site from GitHub, GitHub is the authentication provider). I think you may be misunderstanding its purpose.

The redirect URI in this case would be the application you are providing authentication for. So, if I made an app and wanted to login users with Gitea, I would do this:

1. User clicks login button. My app redirects them to my Gitea instance to login:

```auto
https://mygitea.example/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri="https://myapp.example/oauthredirect"&response_type=code&state=STATE

```

1. User logs in on my Gitea instance. Gitea asks them to authorize my application. User authorizes my application. Gitea redirects user to my application with the authentication data (in this case a code):

```auto
https://myapp.example/oauthredirect?code=RETURNED_CODE&state=STATE

```

1. In my application, I will verify that the code is legitimate and obtain an access token:

```auto
POST https://mygitea.example/login/oauth/access_token

```

1. Gitea will return an access token. I can now get data about the user to create their account, access their data, whatever.

---

<div class="post-metadata">

**Author:** ![controlpl4n3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/controlpl4n3/32/3299_2.png) [@controlpl4n3](https://forum.gitea.com/u/controlpl4n3)\
**Post date:** [December 27, 2022, 3:29pm UTC](https://forum.gitea.com/t/example-redirect-uri-please/6440/3 "2022-12-27T15:29:08Z")

</div>

Oh!  
I didn’t realize gitea could serve as IDP !!!  
That’s so cool
