1

I am trying to use react-openidconnect. Its my first touch with OAuth and OpenIdConnect. I did everything as in example (https://www.npmjs.com/package/react-openidconnect) but i have no idea how to redirect to login page provided by Auth Server. I tried to google it, but didn't find anything.

2 Answers 2

4

Usually you either redirect as a result of one of these actions:

  • Clicking a login button
  • As a result of not having a valid access token and being able to call an API

In both cases you issue an Authorize Redirect by calling userManager.signInRedirect. See this class for an example, from an introductory SPA code sample of mine that you can run.

Sign up to request clarification or add additional context in comments.

Comments

1

The JSX that is set in renderNotAuthenticated (so e.g. the <div>You are not authenticated, please click here to authenticate.</div> in the docs) is rendered inside a clickable div element (see the source for details), so you should be redirected with a click on that.

In case you don't get redirected, you should see an error in the browser's console.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.