chulkilee / ex_force

A Salesforce REST API wrapper for Elixir
https://hex.pm/packages/ex_force
MIT License
38 stars 27 forks source link

Adds support for JWT OAuth flow #68

Open skostojohn opened 2 years ago

skostojohn commented 2 years ago

RE Issue #66

Changes to support JWT auth flow in ex_force. Includes:

  1. New function get_token_jwt to make the auth call and handle results
  2. New function create_jwt_payload to create the JWT assertion payload
  3. Changes to get_token to call the correct function given the grant type
  4. New test helper function assert_form_body_jwt
  5. New tests

The new function get_token_jwt could potentially be avoided, but there are enough differences from the other grant types that it seemed cleaner to create a new function rather than try to add this to the existing function.

I wasn't sure if I needed to make any documentation updates - I can do that if you can point me in the right direction.

As I mentioned earlier, I am a beginner with Elixir - I welcome any feedback and am happy to rework this to better suit your preferences or to make it more Elixir-idiomatic.

Thank you! Scott

sourcelevel-bot[bot] commented 2 years ago

Hello, @skostojohn! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

skostojohn commented 2 years ago

Hi @chulkilee - please let me know if you are waiting for me on any items for this PR. I am new to this, and not sure if I need to anything else to submit it for review. Thanks!