简体   繁体   中英

Use in Azure Active Directory JWT access token in Exoplayer to get Widevine license from Azure Media Service

I know that to get a Widevine license from Azure Media Service (AMS) I need an access token (JWT). I get that token from Azure Active Directory. Now I don't know how to put the access token in the Widevine challenge that Exoplayer does.

My solution that doesn't seem to work:

I use Xamarin, so C#.

I use ADAL to get the token.

I use the StreamingDrmSessionManager.NewWidevineInstance to get the Widevine license and I use this

optionalParams = new Dictionary<string, string> { { "AccessToken", accessToken } }

for the optionalKeyRequestParameters parameter.

What am I doing wrong.

Thanks

Bob, At this point,

  • We are not certain the Xamarin API above or the way you use it supports passing a JWT token to license delivery service in AMS;
  • We are also not certain that the JWT token from Azure AD is correct: it has to perfectly match how you specified when you configure content protection in AMS.

So why don't we go step by step: let's first make sure the Azure AD token and your content protection configuration in AMS match up, by removing the Xamarin player from the picture for the moment.

Use this test player: to test with your protected stream and AAD token https://openidconnectweb.azurewebsites.net/AMTestPlayer If you want to check/match the issuer, audience and (hope you have not added claim, if you have) claims between AAD and AMS, you can use this JWT tool: https://openidconnectweb.azurewebsites.net/DRMTool/Jwt (paste in your JWT from AAD and click on "Parse & Verify" button).

Once we make sure your protected content and your AAD token work well, then we can move to player.

For player, we can temporarily try to use query string "access_token=[JWT]" to pass in the token, just to figure out whether the API supports token passing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM