Skip to content
New issue

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

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

Already on GitHub? # to your account

Add a new OAuth method utilizing JWTs #266

Merged
merged 9 commits into from
Sep 25, 2020
Merged

Conversation

dbhynds
Copy link
Contributor

@dbhynds dbhynds commented Sep 16, 2020

This PR adds a new OAuth method using JWTs as described here:
https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm&type=5

Per the Salesforce documentation, this authentication method does not refresh tokens. As such, the refresh() method just calls authenticate() to generate a new token.

I manually tested this with an app that is set up for JWT auth to verify it works. I also wrote some basic tests based on examples set in other Spec files. Because JWT assertions incorporate an expiration timestamp, I imported the Carbon library and used Carbon::setTestNow() to freeze time so the generated assertions won't change while running tests.

@omniphx
Copy link
Owner

omniphx commented Sep 21, 2020

Hey @dbhynds this looks awesome! I know a lot of people have been requesting JWT. Looks like there is one small conflict to resolve from a recent merge

@dbhynds
Copy link
Contributor Author

dbhynds commented Sep 25, 2020

@omniphx Merge conflicts fixed. Let me know if there's anything else.

@omniphx omniphx merged commit e98c547 into omniphx:master Sep 25, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants