Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExAuth Plugin EM is Unable to extract Client ID from JWT #169

Open
smileysony opened this issue Feb 3, 2020 · 2 comments
Open

ExAuth Plugin EM is Unable to extract Client ID from JWT #169

smileysony opened this issue Feb 3, 2020 · 2 comments

Comments

@smileysony
Copy link

The plugin notes stated that EM will extract the client_id from the JWT.
Sample Log :
2019-12-11T22:00:50.582Z plugin:extauth Found JWK
2019-12-11T22:00:50.590Z plugin:extauth JWT Expiry enabled
2019-12-11T22:00:50.631Z plugin:extauth JWT is valid
2019-12-11T22:00:50.632Z plugin:oauth missing_authorization
2019-12-11T22:00:50.632Z plugin:oauth auth failure 401 missing_authorization Missing Authorization header { 'user-agent': 'PostmanRuntime/7.19.0',

@satishbkodali
Copy link

satishbkodali commented Mar 27, 2020

@keyurkarnik @srinandan

Looks like this plugin is not adding client_id to x-api-key header because of false check

In line 127 and 165, checking for not sendErr. But sendErr is defaulted to true, which makes this check to False. But we need it as true Could you please fix this. as x-api-key is not being passed to oauth plugin and causing issues

Actual :

if (!sendErr) 
	//if this plugin is not sending errors, assume MG is not in local mode
	req.headers['x-api-key'] = jwtdecode.payloadObj[client_id];
}

Expected:

if (sendErr) 
	//if this plugin is not sending errors, assume MG is not in local mode
	req.headers['x-api-key'] = jwtdecode.payloadObj[client_id];
}

Pull request #172

@satishbkodali
Copy link

Fixed as part of #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants