wicked.haufe.io
wicked.haufe.io copied to clipboard
Oauth 2.0 Authentication issue using Auth0.com
Has anyone used Auth0.com as a Oauth 2.0 authentication provider with Wicked?
We are running into an issue with the callback that is crashing the portal itself.
It looks like the callback code cannot decode the jwt. The error generated by the portal follows:
/usr/src/app/auth/oauth2/passport.js:42
var defaultGroups = matchGroups(decodedProfile.group, apiGroups);
^
TypeError: Cannot read property 'group' of null
at Request._callback (/usr/src/app/auth/oauth2/passport.js:42:59)
at Request.self.callback (/usr/src/app/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/usr/src/app/node_modules/request/request.js:1044:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/usr/src/app/node_modules/request/request.js:965:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
It may also be something that I've misconfigured somewhere, but I'm quite new to Oauth so I have no idea where to start,
This will probably be a bug in wicked, unfortunately. The OAuth2 authenticator assumes it gets a "groups" field back as the profile, but Auth0 apparently doesn't return that. This part is not standardized in OAuth.
Will fix for wicked 1.0.0, thanks for pointing out!
I also thought that initially, but, it looks like the decodedProfiile
variable itself is actually null
OK, can I ask you to revisit this with the beta which is due in a couple of weeks? I will try to find time to find out what's different with Auth0's OAuth2 integrtion.