peburrows / goth

Elixir package for Oauth authentication via Google Cloud APIs
http://hexdocs.pm/goth
MIT License
284 stars 108 forks source link

Add support for sub #30

Closed chengyin closed 6 years ago

chengyin commented 6 years ago

This PR preserves all the existing APIs while adding sub support.

In Token and TokenStore, sub is added as an additional parameter in most functions.

In Client, since we need to accommodate iat, I introduced opts, which can be used for either, or both iat and sub. The API signature jwt(scope, iat) is preserved, however I recommend deprecate them in favor of jwt(scope, iat: iat). This also leaves room for potential other optional fields in the future.

Also wrote tests and docs for it.

Fix #29.

peburrows commented 6 years ago

Just included this as part of the v0.8.0 release. Thanks for the PR!