question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for oidc-client-js via redux-oidc

See original GitHub issue

Hi there,

I was wondering whether anyone has been able to get oidc-client-js working with CRA without ejecting?

It is a hard dependency of ours using silent auth implicit flow with kerberos and ldap.

At present we have the following webpack config that we inject in to our apps to support it:

module.exports = {
  entry: {
    silentCallback: ['whatwg-fetch', 'babel-polyfill', './app/src/silent.js']
  },
  plugins: [
    new webpack.optimize.CommonsChunkPlugin({
      name: 'silentCallback',
      chunks: ['commons']
    }),
    new HtmlWebpackPlugin({
      template: './app/src/silent.html',
      chunks: ['silentCallback'],
      filename: 'silent.html',
      inject: 'body'
    }),
    new CopyWebpackPlugin([
      {
        from: '@anz/user-manager/env.js'
      }
    ])
  ]
}

Would be great to hear any pointers on how to achieve this within CRA or some good places to start in creating some functionality to allow it.

Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
flip-itcommented, Aug 8, 2018

@loliver, I got it working without ejecting. When the iframe is calling ‘/silent-renew’ the regular index.html is loaded with the main js bundle. But instead of rendering the react application, I run the callback function.

index.js:

if (window.location.pathname === '/silent-renew') {
    new UserManager().signinSilentCallback();
} else {
    ReactDOM.render(<App />, document.getElementById('root'));
}
1reaction
lolivercommented, Aug 16, 2018

Got this working, thanks for your help @flip-it !

Read more comments on GitHub >

github_iconTop Results From Across the Web

maxmantz/redux-oidc: A package for managing ... - GitHub
A package for managing OpenID-Connect authentication in ReactJS / Redux apps. It wraps the popular oidc-client library to redux actions and reducers.
Read more >
redux-oidc - npm Package Health Analysis - Snyk
A package for managing OpenID-Connect authentication in ReactJS / Redux apps. It wraps the popular oidc-client library to redux actions and reducers.
Read more >
redux-oidc-hooks - NPM Package Overview - Socket.dev
A package for managing OpenID-Connect authentication in ReactJS / Redux apps. It wraps the popular oidc-client-ts library to redux actions and ...
Read more >
Frontend JS - SimpleLogin Docs
oidc -client adds OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications. This library is behind redux-oidc for ReactJS ...
Read more >
Getting a redux-oidc JavaScript error when I try to navigate to ...
I tried implementing redux-oidc by following the guide on the GitHub page. I am connecting to a IDP server built by me using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found