okta / okta-signin-widget

HTML/CSS/JS widget that provides out-of-the-box authentication UX for your organization's apps
Other
376 stars 319 forks source link

Spinner is running continuously after clicking on login button #1510

Open bikas-kumar opened 3 years ago

bikas-kumar commented 3 years ago

Spinner is running continuously after clicking on login button, even the user get authenticated and got success response from /authn call.

swiftone commented 3 years ago

@bikas-kumar - Thanks for the report. What version of the widget are you running, and did you recently upgrade from 4.x to 5.x? There is a migration guide on what to do in such a case: https://github.com/okta/okta-signin-widget/blob/master/MIGRATING.md

bikas-kumar commented 3 years ago

@swiftone I am using version 4.2.2, Do i need to upgrade it?

bikas-kumar commented 3 years ago

ttt I just upgraded to version 5.0.1 but problem still persist. Attaching screenshot for reference

swiftone commented 3 years ago

Upgrading isn't necessary, but switching versions without updating your usage could explain the problem.

Can you share how you are calling the widget?

bikas-kumar commented 3 years ago

@swiftone find the snipped code below

this.oktaSignIn = new OktaSignIn({
      baseUrl: data[this.env].baseUrl,
      clientId: this.clientId, 
      redirectUri: data[this.env].RedirectURL,
      authParams: {
        pkce: false,
        tokenUrl: data[this.env].baseUrl + "/oauth2/" + data[this.env].AuthServerID + "/v1/token",
        issuer: data[this.env].baseUrl + "/oauth2/" + data[this.env].AuthServerID,
        authorizeUrl: data[this.env].baseUrl + "/oauth2/" + data[this.env].AuthServerID + "/v1/authorize",
        responseType: ["token", "id_token"],
        scopes: this.ScopeArray,
        state: btoa(JSON.stringify(this.payloadString)),
        display: 'page',
        getAccessToken: true,
        getIdToken: true,
        grantType: 'implicit'
      }
    });

this.oktaSignIn.renderEl({
        el: '#okta-signin-container'
      },
        (res) => {
console.log(res);
        },
        (err) => {
          console.log(err)
          throw err;
        }
      );
swiftone commented 3 years ago

Sorry for the confusion - are you calling .showSignInToGetTokens(), .showSignInToGetRedirect(), .renderEl()? The handling of the response in one of those is likely where things are not working as you intend.

bikas-kumar commented 3 years ago

I am not calling those methods. Can you please help me with sample example. Not sure how to handle the response.

Thanks, Bikas Kumar

Get Outlook for Androidhttps://aka.ms/ghei36


From: Brett Ritter notifications@github.com Sent: Wednesday, November 18, 2020 11:50:15 PM To: okta/okta-signin-widget okta-signin-widget@noreply.github.com Cc: Bikas Kumar (Digital) bikas.kumar@wipro.com; Mention mention@noreply.github.com Subject: Re: [okta/okta-signin-widget] Spinner is running continuously after clicking on login button (#1510)

This mail has been sent from an external source. Treat hyperlinks and attachments in this email with caution

Sorry for the confusion - are you calling .showSignInToGetTokens(), .showSignInToGetRedirect(), .renderEl()? The handling of the response in one of those is likely where things are not working as you intend.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fokta%2Fokta-signin-widget%2Fissues%2F1510%23issuecomment-729866390&data=04%7C01%7Cbikas.kumar%40wipro.com%7C14eed3564a08486844f808d88bee9a55%7C258ac4e4146a411e9dc879a9e12fd6da%7C1%7C0%7C637413204195151729%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pAU2j2qGSusVuEexigsRo6MNaTrGRRz%2B958Dcq9SQWU%3D&reserved=0, or unsubscribehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJWGXH7JUPAI2C3JBXSJ7LLSQQF57ANCNFSM4TY3VVAA&data=04%7C01%7Cbikas.kumar%40wipro.com%7C14eed3564a08486844f808d88bee9a55%7C258ac4e4146a411e9dc879a9e12fd6da%7C1%7C0%7C637413204195151729%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=U1cZVbQbDWav28lc9Ii5G3B%2BLtCVrUjIaO0Wa8cmpn8%3D&reserved=0.

'The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com'

swiftone commented 3 years ago

Ah, I see you are calling .renderEl() in your snippet of code - I failed to scroll down. Indeed, it looks like you're calling the widget successfully, but you aren't doing anything with the response.

How to handle the response depends on what your application intends to do. After login you are provided with tokens (likely an access token, used to tell other service calls that this user is allowed, and an id token, containing information about the user).

If you're unfamiliar with the options, I suggest checking out the guide here: https://developer.okta.com/docs/concepts/how-okta-works/

Follow-up guides (including those with examples for integrating the widget into different front end JS for SPA applications) or redirecting to urls for the backend to retrieve the tokens (for backend-based Web applications) can be found here: https://developer.okta.com/docs/guides/

For further information I suggest you reach out to our support team at developers@okta.com - they are more familiar with various use-cases for our product, while github issues are focused on API bugs and feature requests.

bikas-kumar commented 3 years ago

@swiftone I am not able to logging itself, after clicking on logging button spinner running continuously.