Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get OKTA sign in widget. #125

Open
pbollaram opened this issue May 13, 2021 · 3 comments
Open

Unable to get OKTA sign in widget. #125

pbollaram opened this issue May 13, 2021 · 3 comments

Comments

@pbollaram
Copy link

Hi,
I am setting up OKTA login with my app and for some reasons i am unable to view sign in widget.
I see GET https://.oktapreview.com/.well-known/openid-configuration call is keep getting cancelled(abandoned) for no reason.

image

image

Here is my configuration.

const oktaAuth = new OktaAuth({
  issuer: 'https://<domain>.oktapreview.com',
  clientId: process.env.REACT_APP_OKTA_CLIENT_ID,
  redirectUri: window.location.origin + '/implicit/callback',
    pkce: true,
  scope: ['openid', 'profile', 'email', 'groups'],
  cookies: {
    secure: window.location.protocol === 'https:',
  },
  tokenManager: {
    autoRenew: true,
    secure: true,
    storage: 'localStorage',
  },
});

const App =()=>{
  const history = useHistory();
  const restoreOriginalUri = async (_oktaAuth, originalUri) => {
    history.replace(toRelativeUrl(originalUri, window.location.origin));
  };
   <Security oktaAuth={oktaAuth} restoreOriginalUri={restoreOriginalUri}>
       <Switch>
                <Route path='/' exact={true} component={Home}/>
                <Route path='/implicit/callback' component={LoginCallback}/>
                <Route path='/dashboard' component={Dashboard}/>
         </Switch>
     </Security>
 
}

Home.js

function Home(){
 const login = async () => { await oktaAuth.signInWithRedirect(); }
  return(
  <button onClick={login} ></button>
  )
}

Okta package that i am using.

@okta/okta-auth-js": "^4.8.0",
@okta/okta-react": "^5.0.0",

@amcdnl
Copy link
Contributor

amcdnl commented May 14, 2021

See: #118 (comment)

@pbollaram
Copy link
Author

@amcdnl
upgrading to @okta/okta-react: '^5.1.1' and @okta/okta-auth-js: '^4.9.0' did not work. i still dont see sign in widget.

@pbollaram
Copy link
Author

i have downgraded Okta version and still i see all of .well-known/openid-configuration calls care getting cancelled.

Request URL: https:///.well-known/openid-configuration
Referrer Policy: strict-origin-when-cross-origin
Provisional headers are shown
accept: application/json
content-type: application/json
Referer: http://localhost:3000/
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
x-okta-user-agent-extended: @okta/okta-react/3.0.8 okta-auth-js/3.2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants