Closed acoumb closed 1 year ago
Included with this PR some additional changes to Authorized Services:
TokenEncryptionKey
as the focus is on the encryptor using IDataProtectionProvider
.UseProofKeyForCodeExchange
flag. A flow description can be found here.State
, Code Verifier
and Code Challenge
authorization parameters into an AuthorizationPayload
object that is cached between authorization and access token request.Testing with Aprimo succeeded with some "hacking", because the OAuth app is managed by them and I cannot change the redirect uri
myself. Had to manually copy URL parts and jump between sessions to get some results. After Easter and release of the Aprimo package, I will address this with them and have the URL changed.
Feedback resolved, merging updates.
Current PR contains the implemented features for encrypting/decrypting access tokens and refresh tokens using the
IDataProtectionProvider
and state handling for OAuth requests during the authorization flow.The tokens are encrypted in the storage provider during the CRUD operations, and maybe we can also consider encrypting the settings
TokenEncryptionKey
key usingAES
.For authorization requests, a random string is generated for the service and used in the authorization request sent to the provider. The value is cached temporarily using a Singleton dictionary and validated during the service response evaluation. Then it gets removed from the cache.