# Cannot Generate OAuth2 Token - "redirect\_uri" parameter does not match

**URL:** <https://forum.pydio.com/t/cannot-generate-oauth2-token-redirect-uri-parameter-does-not-match/3649>\
**Category:** Pydio Cells\
**Tags:** authentication, api\
**Created:** [December 30, 2020, 3:09pm UTC](https://forum.pydio.com/t/cannot-generate-oauth2-token-redirect-uri-parameter-does-not-match/3649 "2020-12-30T15:09:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zolointo](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/zolointo/32/1017_2.png) [@zolointo](https://forum.pydio.com/u/zolointo)\
**Post date:** [December 30, 2020, 3:09pm UTC](https://forum.pydio.com/t/cannot-generate-oauth2-token-redirect-uri-parameter-does-not-match/3649/1 "2020-12-30T15:09:48Z")

</div>

Morning!

**In Short**  
I’ve been attempting to generate a token for some API work by following the official docs and forum posts, but I keep hitting this **redirect\_uri** error brick wall.

**Environment**  
I have an Unraid Server and have installed the [Pydio Cells 2.1 Home docker container](https://hub.docker.com/r/linuxserver/pydio-cells) on [https://192.168.1.100:8080](https://192.168.1.100:8080). The web frontend works without issue.

**Method**  
I’m focusing on following the [Postman config example](https://pydio.com/en/docs/developer-guide/using-postman), and currently have the following parameters:

 ![oauth2_settings](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/d/dd77e9a4436fd04aa666521e0663183d492ecff2.png)

**Problem**  
Whether I use a Callback setting of

- Authorize using browser
- [https://192.168.1.100:3636](https://192.168.1.100:3636) (ignore http in screenshot)
- [https://192.168.1.100:3000/servers/callback](https://192.168.1.100:3000/servers/callback)
- [https://192.168.1.100:3000](https://192.168.1.100:3000)

I _always_ get the redirect\_uri error message:

> The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed" error=invalid\_request hint="The "redirect\_uri" parameter does not match any of the OAuth 2.0 Client’s pre-registered redirect urls

The only other clue I found was using the openid info page [https://192.168.1.100:8080/oidc/.well-known/openid-configuration](https://192.168.1.100:8080/oidc/.well-known/openid-configuration) which seems to confirm that I’m using the right settings?

 ![openid-configuration](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/9/96ab03101f264a9e76eb9b9cdea23f94e54d3dc5.png)

**Help?**  
I’ve read through what I think are the pertinent docs and forum posts. The closest matching post seems to be [this one](https://forum.pydio.com/t/cells-client-oauth-config-fails/3502/3), but the advice of ‘restart cells’ doesn’t work, and there hasn’t been any other follow up.

Any advice on what I should change or try next?

---

<div class="post-metadata">

**Author:** ![zolointo](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/zolointo/32/1017_2.png) [@zolointo](https://forum.pydio.com/u/zolointo)\
**Post date:** [December 30, 2020, 7:18pm UTC](https://forum.pydio.com/t/cannot-generate-oauth2-token-redirect-uri-parameter-does-not-match/3649/2 "2020-12-30T19:18:55Z")

</div>

Finally figured it out!

First, I noticed that I was using the wrong callback url, so I changed it to [http://localhost:3000/servers/callback](http://localhost:3000/servers/callback). This still didn’t get me around the issue.

Someone suggested that I needed to put something into the State box. This sounded familiar so I looked into the [official documentation](https://pydio.com/en/docs/developer-guide/using-postman) and found:  
**State** : you can put whatever you want (minimum 8 characters)

I had read this statement as “you can leave this blank OR put a minimum of 8 characters in this box”, and had left the box empty up until now. As soon as I typed in 8+ chars, bingo!

 ![pydio_cells_postman_works](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/0/04e2995f5e924391e523c0776cab89f573ed75ed.png)

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [January 5, 2021, 10:24am UTC](https://forum.pydio.com/t/cannot-generate-oauth2-token-redirect-uri-parameter-does-not-match/3649/3 "2021-01-05T10:24:53Z")

</div>

Hello @zolointo,

Glad that you figured out your issue,

> [@zolointo](#):
>
> Someone suggested that I needed to put something into the State box. This sounded familiar so I looked into the [official documentation](https://pydio.com/en/docs/developer-guide/using-postman) and found:  
> **State** : you can put whatever you want (minimum 8 characters)

We will change the wording on the documentation so that it suggests that you “must” put a state with the 8 characters condition.

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [January 5, 2021, 10:24am UTC](https://forum.pydio.com/t/cannot-generate-oauth2-token-redirect-uri-parameter-does-not-match/3649/4 "2021-01-05T10:24:57Z")

</div>


