# How can I build the "redirect"?

**URL:** <https://devforum.okta.com/t/how-can-i-build-the-redirect/16506>\
**Category:** Questions\
**Created:** [October 7, 2021, 4:04pm UTC](https://devforum.okta.com/t/how-can-i-build-the-redirect/16506 "2021-10-07T16:04:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richie](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/richie/32/3362_2.png) [@Richie](https://devforum.okta.com/u/Richie)\
**Post date:** [October 7, 2021, 4:04pm UTC](https://devforum.okta.com/t/how-can-i-build-the-redirect/16506/1 "2021-10-07T16:04:00Z")

</div>

I am just starting out here so please excuse the lack of knowledge. I have a landing page built with Wordpress/Elementor for a AWS hosted regular old webapp. On it I have a button “Log into system”. I’d like to send the user to the Okta hosted sign in page for me. Once authenticated I will sent the user to my app via app url.The only example I have found uses curl to build the string. I have tried filling in with my own data but I get an error of some sort. Is there some tool up here that will help me built the query string? Once I have this build I plan to insert the string directly into my Elementor landing page. Am I on the right track?

---

<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:** [October 7, 2021, 4:34pm UTC](https://devforum.okta.com/t/how-can-i-build-the-redirect/16506/2 "2021-10-07T16:34:30Z")

</div>

Hello! Because the /authorize URL must be redirected to, the simplest way to set it up is with an anchor tag:

`<a href="https://example.okta.com/oauth2/v1/authorize?client_id=...">Login</a>`

Does that work for your use case?

---

<div class="post-metadata">

**Author:** ![Richie](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/richie/32/3362_2.png) [@Richie](https://devforum.okta.com/u/Richie)\
**Post date:** [October 7, 2021, 5:22pm UTC](https://devforum.okta.com/t/how-can-i-build-the-redirect/16506/3 "2021-10-07T17:22:51Z")

</div>

Thanks for the quick response. My landing page already has a button. This function gets called when a user clicks on it:

```auto
function myFunction() {
  window.open("http://stage.researchstudyonline.com:81/index.php/Users_start_login", "_blank");
}

```

I want to change this to popup the Okta hosted login widget when a user clicks on the button. I realize that I need to replace some of the fields in “https://okta\_domain.okta.com/oauth2/v1/authorize?client\_id=…”. But I was hoping there was some tool I could use to build that URL path? I tried building it by hand and it didn’t work.

---

<div class="post-metadata">

**Author:** ![nsheikh](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nsheikh/32/3388_2.png) [@nsheikh](https://devforum.okta.com/u/nsheikh)\
**Post date:** [October 9, 2021, 11:29am UTC](https://devforum.okta.com/t/how-can-i-build-the-redirect/16506/4 "2021-10-09T11:29:48Z")

</div>

The documentation on the link below should help in constructing the authorize API request:

Implicit Flow:  
[Implement authorization by grant type | Okta Developer](https://developer.okta.com/docs/guides/implement-grant-type/implicit/main/#set-up-your-app)

Auth Code Flow:  
[Implement authorization by grant type | Okta Developer](https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/#set-up-your-app)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 10, 2024, 1:00am UTC](https://devforum.okta.com/t/how-can-i-build-the-redirect/16506/5 "2024-02-10T01:00:47Z")

</div>

Closed on February 10, 2024, 1:00am UTC


