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

feat(api): integrate newmatik Next token validation #45

Merged
merged 1 commit into from Aug 13, 2020

Conversation

ronelvcabrera
Copy link

re https://github.com/newmatik/newmatik/issues/3406

with this change, we need to change Newmatik Next as well to have a prefix of "next" before the token.

Success Login

Screen Shot 2020-08-12 at 5 40 41 PM

Success request on a whitelisted endpoint

Screen Shot 2020-08-12 at 5 48 44 PM

Failed request on a whitelisted endpoint

Screen Shot 2020-08-12 at 5 48 22 PM

@KanchanChauhan
Copy link

@ronelvcabrera next is not a valid authorization type, in our case, it should be token then we don't need extra if statement as well https://github.com/newmatik/frappe/pull/45/files#diff-338b4afd2c42a3e36c09be80a5873bc1R168

Something like this will be needed on the NEXT side.
header = {"Authorization": "token {}".format(jwt_token)}

@ronelvcabrera
Copy link
Author

@KanchanChauhan No. If we use "token", it will be taken to another another function by frappe, which uses the api_key and api_secret as validation. Which does not have a expiration time, which JWT has.

@creamdory creamdory merged commit a4f331a into newmatik:version-12-0812 Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants