Closed nbkntu closed 6 years ago
The main purpose for setting the ngx.ctx.authenticated_consumer
was to make this plugin somehow compatible with other plugins, which could use the information about the consumer, but I know it was a bit of a hack.
There's also an another object called authenticated_credential
, which has the similar purpose, but I think, it's designed for the case, then the user isn't in KongDB. Could you try to replace ngx.ctx.authenticated_consumer
with ngx.ctx.authenticated_credential
?
BTW. Could I know what OIDC Provider do you use?
I upgraded kong from 0.11 to 0.12 and ran into a problem with consumer_id which didn't happen before.
When user logs in successfully, kong-oidc passes
user.sub
as the id inngx.ctx.authenticated_consumer
.https://github.com/nokia/kong-oidc/blob/6ff94662ff78e1c61149b8d09f872bf3b34170a3/kong/plugins/oidc/utils.lua#L64
This will trigger consumer lookup at kong level. Since the
user.sub
that I have is not a uuid, it results in error.It's running fine when I comment out the code that sets
ngx.ctx.authenticated_consumer
.