auth0 / Guardian.swift

Swift toolkit for Auth0 Guardian API
https://auth0.com/guardian
MIT License
9 stars 19 forks source link

Use JWT tokens when updating and deleting enrolled devices [SDK-2560] #91

Closed Widcket closed 3 years ago

Widcket commented 3 years ago

Description

This PR adds a new method to APIClient that returns an instance of DeviceAPIClient configured to use a JWT token instead of an opaque token. With this new method, the DELETE and PATCH requests to /api/device-accounts will use a JWT bearer token generated and signed for each request.

The JWT is generated with the following claims:

https://user-images.githubusercontent.com/5055789/118770294-89e3b800-b857-11eb-8e8b-ddab8dfb8248.MP4

Testing

Unit tests have been added for this new method, and for the new claim set. Also, the change has been tested manually with Guardian.iOS.

Checklist