redux-oidc-example | Small ReactJS application to demonstrate the usage | State Container library
kandi X-RAY | redux-oidc-example Summary
kandi X-RAY | redux-oidc-example Summary
Small ReactJS application to demonstrate the usage of redux-oidc
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- The React Class .
- Creates new map state .
- Creates a new state manager .
- Create history .
- Create a new state object .
- Creates the hash history .
- Create browser history
- Internal helper to create query objects based on the given location options .
- Set the basename of the page .
- Sync reducer with history store .
redux-oidc-example Key Features
redux-oidc-example Examples and Code Snippets
Community Discussions
Trending Discussions on redux-oidc-example
QUESTION
I have a React application created using the create-react-app module. I have recently been asked by a client to integrate with oidc. For this purpose I'm using redux-oidc, as I already have redux working in my app as well.
We managed to integrate my application into their Identity server and I'm able to sign in and get the user token stored in redux. The problem is that I'm struggling to setup silent renew in my create-react-app application as I have to add an additional entry point. Is there a way to add an additional entry point to silent_renew/index.js
without ejecting create-react-app?
Currently I've create a folder called silent_renew containing an index.js
file. This folder also contains a silent_renew.html
file with not much in it (See: example app similar to my folder structure).
ANSWER
Answered 2017-May-14 at 17:22You cannot add a custom webpack loader if you haven't ejected:
We don't intend to provide Webpack specific overrides because it will be very fragile. People will start depending on specific loaders and plugins and we won't be able to improve the overall experience.
source: https://github.com/facebookincubator/create-react-app/issues/99#issuecomment-234657710
If you want to add a new specific entry file you first need to yarn eject
then edit config/webpack.config.dev.js:34
and config/webpack.config.prod.js:55
.
The same is valid for adding new webpack loaders.
QUESTION
I'm setting up an identity authentication for a project im currently working on. I need to be able to push a button to log into my server and then be redirected to IdentityServer4 and back again to my application.
I'm using "react-router-dom": "^4.3.1", "redux-oidc": "^3.1.4", "oidc-client": "^1.8.2",
And the projects backend is set up using .NET. I've taken the https://github.com/maxmantz/redux-oidc-example example to start my implementation and used http://docs.identityserver.io/en/aspnetcore1/quickstarts/7_javascript_client.html first to make it so that the backend and API worked.
My problem is pretty much the same as https://github.com/maxmantz/redux-oidc/issues/96 but I'm not understanding how to solve it.
I've tried solving it with different links I've found but they all keep going back to the same issue. I think thats because of the routing like mentioned earlier.
FrontEnd:
App and index:
...ANSWER
Answered 2019-Aug-12 at 08:58Just moved my Route for landing page beneath callback and it works.
QUESTION
I have cloned the repo from the redux-oidc-example and it works for the most part but after a few hours it gives the following error:
Action payload: ErrorResponse: login_required
at new e (oidc-client.min.js:1)
at t [as _processSigninParams] (oidc-client.min.js:1)
at t [as validateSigninResponse] (oidc-client.min.js:1)
at oidc-client.min.js:1
UserManager.js looks like this:
...ANSWER
Answered 2019-Nov-20 at 09:11This is likely due to your IDP session expiring - if you call the authorize
endpoint with prompt=none
but it's unable to satisfy that request because no valid session exists (i.e. authentication cookie does not exist or has expired) then it will return error=login_required
.
If this occurs then the correct course of action is to do an interactive (i.e. prompt=login
) sign in request in the top level browser window.
QUESTION
I'm building a React app where I want to authenticate the user using OpenID Connect. In my dev environment the OIDC authority is a locally running instance of Identity Server 4.
I found a Github repo which integrates the oidc-client-js library with Redux so I downloaded the example repo and pointed it at my Identity Server. The only other change I made was to call a local API with my bearer token instead of the YouTube one used by the sample.
I have a Windows environment.
On Chrome and Edge the example works perfectly. I am able to authenticate and successfully call my local API using the bearer token. However, on Firefox, although the authentication works correctly and my API gets called successfully with results displayed, after a few seconds the app suddenly appears to sign the user out. (I say 'appears' because it behaves as though the user has been signed out but if I reload the page, the user is already authenticated).
Note: I've crossed out a section here. This was a red herring. See Update 1 below which describes how Firefox is adding a second iframe. A redirect URL wasn't registered for my client causing a redirect to IS4's error page which was responsible for these CSP warnings.
Looking at the console logs, a key difference between Chrome and Firefox is a warning I'm seeing in Firefox:
Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
This appears in the console a second or two after authenticating the user. I suspect this might be related to the iframe the Javascript OIDC client adds for checking the session. This iframe points at /connect/checksession on the identity authority.
If I navigate to this checksession URL in Firefox I get a Javascript error in the console:
Content Security Policy: The page's settings blocked the loading of a resource at self ("script-src").
I don't see this error in Chrome.
The Content-Security-Policy
for this page is default-src 'none'; script-src 'sha256-VDXN0nOpFPQ102CIVz+eimHA5e+wTeoUUQj5ZYbtn8w='
The only other bit of info I can provide is the console logs that are written as Firefox appears to sign the user out:
...ANSWER
Answered 2018-Apr-20 at 16:55I was seeing this behaviour intermittently in Chrome when using oidc-client-js directly. In my case adding a call to clearStaleState on the UserManager seemed to stop this from happening. EDIT: Specifically I added it before the call to getUser().
But since it was intermittent, it'd go away for a time if you logged out and cleared cookies and local/session storage, I can't guarantee this will fix it.
QUESTION
My identityserver4 client looks like this:
...ANSWER
Answered 2018-May-17 at 10:39Your code contains two different grant types. The different Grant types in Identity server 4 have different requirements. Here is a bit of information to help you understand the different types you are using. It may also help you understand why you were having this problem.
GrantTypes.ClientCredentials
The Client credentials is the simplest grant type and is used for server to server communication - tokens are always requested on behalf of a client, not a user.
With this grant type you send a token request to the token endpoint, and get an access token back that represents the client. The client typically has to authenticate with the token endpoint using its client ID and secret.
QUESTION
I'm trying to use oidc-client
library in my React project but run into the same error everytime I run the code :
Babel - Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined
I know that there's a specific Redux implementation of this library but I've had the same issue so I'm taking a step back. I'll use the Redux implemenation once my issue is fixed.
I've pulled the redux-oidc-example
code and I'm running both at the same time, trying to find what makes it break. The results I've had so far are :
- Webpack configs are the same (mostly)
- All "important" dependencies are the same, with the same version.
At this point I'm trying to align every dependencies to see if one of them is responsible but I'd welcome any idea.
EDIT after @MinusFour comment : running npm ls buffer
produce the following :
ANSWER
Answered 2017-Oct-16 at 00:12After a week worth of investigation (thanks to @MinusFour for setting me on the right path), It appears that it was a Webpack loader issue.
In the babel-loader
configuration, you need to exclude node_modules in a very peculiar way. redux-oidc-example
does it by using a regex and I was using an array of strings.
If you want to be compliant with Webpack convention and use an array of String, you can exclude nodes_modules this way :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redux-oidc-example
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page