Hello,
I am trying out the lib using https://github.com/maxmantz/redux-oidc as a wrapper.
I am experiencing some trouble with my redirect callback that gives me signature validation failed. I want to enable logging so I can check if a raw exception gives me any clues.
I have tried import Oidc from 'oidc-client'; Oidc.Log.logger = console;both in my Express server file, and in my Root React component, but nothing happens.
Am I totally on the wrong track here? @maxmantz ref: https://github.com/maxmantz/redux-oidc/issues/5
Does Oidc.Log.level = Oidc.Log.INFO help?
Also, you can plug in any object for logging that supports info, warn, and error with params: https://github.com/IdentityModel/oidc-client-js/blob/master/src/Log.js#L53
I've just tried the following to enable logging in my example app:
import { Log } from 'oidc-client';
Log.logger = console;
Now when I try to log in I get the same error as you (stuck on Redirecting...):
redux-oidc.js:1 Uncaught (in promise) Error: Error handling redirect callback: signature validation failed.
When I remove the logging again, no error occurs and the log in works fine. Any ideas as to what could cause this?
That's bizarre, but makes me feel like there's a bug somewhere.
Aha! I get the same error. Everything works fine, but if I add the following the redirect error appears:
import { Log } from 'oidc-client';
Log.logger = console;
Log.level = Log.INFO;
Still no logging when I set the Log.level = Log.INFO;, though.
Do you have a repro with the sample perchance? I don't have a setup with google's OP.
I've used my sample app for testing this. I've enabled logging in src/index.js as described above to get the error.
I found it impossible to troubleshoot myself because oidc-client was built into my library as a dependency and therefore got minified and mangled along with all of my code.
I have updated the app to use the latest version of my library. It now has oidc-client as a peer dependency. This means that now there is a separate folder oidc-client inside node_modules. In there you can replace lib/oidc-client.min.js with lib/oidc-client.js to get sourcemap debugging for oidc-client. It is a bit fiddly but it works.
I am just back this week from being away. Did either of you happen to discover anything else about this? Thanks.
No not yet. The issue still persists. I have changed the use of oidc-client in my library to a peer dependency to allow manual changes to the version of the library. You could now make changes to your library (oidc-client), compile it, and manually copy it to the sample app's node_modules/oidc-client directory for debugging. This is a rather complicated approach, but the only worthwhile one I can think of.
You simply have to include what @lizter wrote to enabling logging in src/index.js to get to the problem.
I have the same problem.
In my entry.js I am trying to set the logger in 1.3.0 using:
if(process.env.ENABLE_OIDC_LOG) {
const {Log} = require('oidc-client');
Log.logger = console;
Log.level = Log.DEBUG;
}
The logger is set, but only a very small amount is being logged, despite setting it to Log.DEBUG.
I only see user loaded and sometimes signinSilent successful, signed in sub: [...]. Some time ago, there would be very much logging going on. I don't know what happened. Since automaticSilentRenew is set to true, it should log much more.
Ok, nevermind. The chromium console filter was set to "Info" and not "Verbose". It logs again
Just add the same issue...thought that DEBUG log level was not working but was indeed the Chrome console filter not set to Verbose. This issue can be closed IMO @brockallen @Gurkenschreck.
i have oidc-client used in auth-angular project which is then consumed as npm in my main-app. i am not able to see log statments written in oidc-client , any suggestions how to approach this ?
app1 -> uses oidc-client
app2 -> uses npm of app1
Most helpful comment
Ok, nevermind. The chromium console filter was set to "Info" and not "Verbose". It logs again