-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure Media Services, support for Azure AD authentication (#1940)
* Update api version + update sas token to support 256MB uploads * Add Azure Ad authentication + Remove ACS authentication * Add AzureAD authentication (fixes previous commit) * Added missing configuration settings for AD tests (user credentials and service principal certificate) * Fix integration tests + stabilization * Removed debug info in canUploadLargeBlockBlob test * Fix javadoc * Update streaming endpoint create operation + Add integration test * Fix checkstyle issues * Fixed JavaDoc typo in MediaService class * Fix checkstyle issues #2 * Fix checkstyle issues #3 * Fix checkstyles #4 * Minor refactor in AzureAdTokenProviderTest class * Fix task integration test assert * Add TokenProvider interface * Fix checkstyle errors
- Loading branch information
1 parent
5213491
commit 38300c2
Showing
42 changed files
with
1,110 additions
and
1,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...ain/java/com/microsoft/windowsazure/services/media/authentication/AzureAdAccessToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.microsoft.windowsazure.services.media.authentication; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* Represents an access token | ||
*/ | ||
public class AzureAdAccessToken { | ||
|
||
private final String accessToken; | ||
|
||
private final Date expiresOn; | ||
|
||
/** | ||
* Gets the access token | ||
* @return the access token | ||
*/ | ||
public String getAccessToken() { | ||
return this.accessToken; | ||
} | ||
|
||
/** | ||
* Gets the expiration date | ||
* @return the expiration date | ||
*/ | ||
public Date getExpiresOnDate() { | ||
return this.expiresOn; | ||
} | ||
|
||
/** | ||
* Instantiate a representation of an access token | ||
* @param accessToken the access token | ||
* @param expiresOn the expiration date | ||
*/ | ||
public AzureAdAccessToken(String accessToken, Date expiresOn) { | ||
|
||
if (accessToken == null || accessToken.trim().isEmpty()) { | ||
throw new IllegalArgumentException("accessToken"); | ||
} | ||
|
||
if (expiresOn == null) { | ||
throw new NullPointerException("expiresOn"); | ||
} | ||
|
||
this.accessToken = accessToken; | ||
this.expiresOn = expiresOn; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...a/com/microsoft/windowsazure/services/media/authentication/AzureAdClientSymmetricKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.microsoft.windowsazure.services.media.authentication; | ||
|
||
/** | ||
* Represents a symmetric key pair of ClientId & ClientKey | ||
*/ | ||
public class AzureAdClientSymmetricKey { | ||
|
||
private final String clientId; | ||
private final String clientKey; | ||
|
||
/** | ||
* Gets the client ID. | ||
* @return the client ID. | ||
*/ | ||
public String getClientId() { | ||
return this.clientId; | ||
} | ||
|
||
/** | ||
* Gets the client key. | ||
* @return the client key. | ||
*/ | ||
public String getClientKey() { | ||
return this.clientKey; | ||
} | ||
|
||
/** | ||
* Initializes a new instance of the AzureAdClientSymmetricKey class. | ||
* @param clientId The client ID. | ||
* @param clientKey The client key. | ||
*/ | ||
public AzureAdClientSymmetricKey(String clientId, String clientKey) { | ||
if (clientId == null || clientId.trim().isEmpty()) { | ||
throw new IllegalArgumentException("clientId"); | ||
} | ||
|
||
if (clientKey == null || clientKey.trim().isEmpty()) { | ||
throw new IllegalArgumentException("clientKey"); | ||
} | ||
|
||
this.clientId = clientId; | ||
this.clientKey = clientKey; | ||
} | ||
} |
Oops, something went wrong.