# How to access to registration via login Widget?

**URL:** <https://devforum.okta.com/t/how-to-access-to-registration-via-login-widget/15373>\
**Category:** Questions\
**Created:** [August 2, 2021, 2:32pm UTC](https://devforum.okta.com/t/how-to-access-to-registration-via-login-widget/15373 "2021-08-02T14:32:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AleixR](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@AleixR](https://devforum.okta.com/u/AleixR)\
**Post date:** [August 2, 2021, 2:32pm UTC](https://devforum.okta.com/t/how-to-access-to-registration-via-login-widget/15373/1 "2021-08-02T14:32:51Z")

</div>

Hi!

I’ve implemented the Sign In widget in my app using this url:

> https://${myOktaDomain}/oauth2/default/v1/authorize

It works fine, but I actually want to enter directly to the registration form that is also available in this widget. The design I planned is a screen with two buttons (login and registration). The login button leads the user to the Sign In screen and I want the registration button to work as the login button but with the Sign Up case. Since the widget has it done, but with an anchor at the bottom of the login form I thought it would be also possible to access directly to the registration form when clicking the button on the app.

This is the step I’m looking to avoid:

 ![login-reg-widget-](https://global.discourse-cdn.com/oktadev/original/2X/0/09b1d2109e22f5ba488b3137e65274df205ee529.png)

Any suggestions?

Thanks in advance!

---

<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:** [August 3, 2021, 4:51pm UTC](https://devforum.okta.com/t/how-to-access-to-registration-via-login-widget/15373/2 "2021-08-03T16:51:14Z")

</div>

There is no built in way to achieve this. See related threads about this question for reference/options:

> [@Showing registration step right away in sign in widget](https://devforum.okta.com/t/showing-registration-step-right-away-in-sign-in-widget/14557/4):
>
> Ah, I should’ve checked which widget version you were using before answering. Sadly, this is not possible without a hacky solution like simulating a click on the “Sign Up” anchor tag.

and an older GH thread about this request: [Initialize Widget directly in registration view · Issue #587 · okta/okta-signin-widget · GitHub](https://github.com/okta/okta-signin-widget/issues/587#issuecomment-439475939)

* * *

One of the more common solutions I’ve heard of is to emulate the user clicking this button so the registration view is shown instead. See some example code for what this looks like below (note that the class name may vary depending on the widget version being used):

```auto
// Render the Okta Sign-In Widget
var oktaSignIn = new OktaSignIn(config);

oktaSignIn.on('afterRender', function (data) {
  // This is the code that makes it look as if the Okta Sign-In Widget has been loaded to the "Registration" view
  const view = data.controller;
  if(view == 'primary-auth') {
    if(registrationNotClicked) {
      registrationNotClicked = false;
      document.getElementsByClassName("registration-link")[0].click();
    }

```

---

<div class="post-metadata">

**Author:** ![AleixR](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@AleixR](https://devforum.okta.com/u/AleixR)\
**Post date:** [August 5, 2021, 2:04pm UTC](https://devforum.okta.com/t/how-to-access-to-registration-via-login-widget/15373/3 "2021-08-05T14:04:32Z")

</div>

Thanks for answering. After many days looking for a solution I think this is the only way to get it. I’ll be looking for this feature in the next updates of the Widget.

---

<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:** [August 6, 2021, 2:05pm UTC](https://devforum.okta.com/t/how-to-access-to-registration-via-login-widget/15373/4 "2021-08-06T14:05:10Z")

</div>

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