Redirect URL Skip to main content
https://support.okta.com/help/answers?id=9062a000000xzrvqaw&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
karan singhkaran singh 

Redirect URL

We are using okata sign in widget: https://developer.okta.com/code/javascript/okta_sign-in_widget.html
Using the below code it does authenticates fine but when I use the redirect URL throws error:
"403  Access Forbidden"  You dont have permission to access this page. We even tried with google.com as below but still no help. Please provide inputs.

 <script type="text/javascript">
        var orgUrl = 'https://mydev.oktapreview.com';
        var redirectUrl = 'www.google.com';
        var OKTA_CLIENT_ID = 'clientid';
        //redirectUri: '{{ base_url }}/oauth2/v1/widget/callback?targetOrigin={{ ngrok_url }}/widget',

        var oktaSignIn = new OktaSignIn({baseUrl: orgUrl});

        oktaSignIn.renderEl(
          { el: '#okta-login-container' },
          function (res) {
              if (res.status === 'SUCCESS') {
                  debugger;
                  res.session.setCookieAndRedirect(redirectUrl);
              }
          }
        );
    </script>
Valentin NituValentin Nitu (Okta, Inc.)
Hey Karan, from the looks of it the issue is that you are attempting to redirect the user to an Url outside of Okta. Try to use a link in Okta for redirect.
For example try to create a bookmark app for the google page and use the bookmark app`s embed link.
If the issue presists even with this change then I would suggest to reach out to the developer team for further assistance.