AzureAD / microsoft-authentication-library-common-for-android

Common code used by both the Active Directory Authentication Library (ADAL) and the Microsoft Authentication Library (MSAL)
MIT License
41 stars 35 forks source link

Add parseTokenResponse method to IAcquireMicrosoftStsTokenStrategy interface #2263

Closed iamgusain closed 7 months ago

iamgusain commented 10 months ago

What

Adding a new method parseTokenResponse to IAcquireMicrosoftStsTokenStrategy interface to handle processing response from server for TokenRequest

Why

The method is used processes and decrypts (if encrypted) the response body returned from server to MicrosoftTokenResponse JSON response format string. If Server returns an encrypted response (PRT protocol), we need to decrypt it before serializing it to TokenResponse object. This method is used to perform the decryption.

This change also removes the acquireToken method from the interface. This is to separate the responsibility perfroming token requests from request creation and response processing. More details in the related Broker PR https://github.com/AzureAD/ad-accounts-for-android/pull/2638

Related

Broker PR: https://github.com/AzureAD/ad-accounts-for-android/pull/2638