# Okta redirection fails with React HashRouter

**URL:** <https://devforum.okta.com/t/okta-redirection-fails-with-react-hashrouter/13747>\
**Category:** Questions\
**Created:** [April 12, 2021, 8:07am UTC](https://devforum.okta.com/t/okta-redirection-fails-with-react-hashrouter/13747 "2021-04-12T08:07:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhukirans](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@madhukirans](https://devforum.okta.com/u/madhukirans)\
**Post date:** [April 12, 2021, 8:07am UTC](https://devforum.okta.com/t/okta-redirection-fails-with-react-hashrouter/13747/1 "2021-04-12T08:07:21Z")

</div>

My App is using HashRouters now I want to integrate OKTA Authentication but that issue is Okta does not allow to add # in the redirection URL. As a result after successful login, I am landing on a 404 unknown pages. I don’t want to use change to Browser routers

Could anybody suggest to me how to deal with #Routes with OKta redirection…?

If possible can you please provide an example?

---

<div class="post-metadata">

**Author:** ![Cale](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/cale/32/2496_2.png) [@Cale](https://devforum.okta.com/u/Cale)\
**Post date:** [April 12, 2021, 2:12pm UTC](https://devforum.okta.com/t/okta-redirection-fails-with-react-hashrouter/13747/2 "2021-04-12T14:12:31Z")

</div>

Hi there. Take a look at our [React sample app](https://github.com/okta/samples-js-react) for an example of how we implement react router - here is a link specifically to the routing code:

> <https://github.com/okta/samples-js-react/blob/master/custom-login/src/App.jsx>

I hope that helps!

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [April 12, 2021, 4:25pm UTC](https://devforum.okta.com/t/okta-redirection-fails-with-react-hashrouter/13747/3 "2021-04-12T16:25:14Z")

</div>

You cannot use # in a redirect URL because of OAuth, not Okta. See [RFC 6749 - The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749#section-3.1.2).

> The endpoint URI MUST NOT include a fragment component

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 6, 2024, 11:27pm UTC](https://devforum.okta.com/t/okta-redirection-fails-with-react-hashrouter/13747/4 "2024-02-06T23:27:45Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
