Skip to content

Commit

Permalink
Exposes id_token via AuthenticationResult (#870) (#871)
Browse files Browse the repository at this point in the history
* Re #850

* Rev version number -> 1.1.0

* Update changelog for 1.1.0

* Improving javadoc
  • Loading branch information
iambmelt authored Dec 18, 2019
1 parent e3d5403 commit c7daa6e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
MSAL Wiki : https://github.com/AzureAD/microsoft-authentication-library-for-android/wiki

Version 1.1.0
----------------------------
- Expose id_token (raw) via IAccount/ITenantProfile from AuthenticationResult (#850)

Version 1.0.1
----------------------------
- Fix issue #785, #786, #805, #806, #807, #816, #828, #855, #859
Expand Down
9 changes: 9 additions & 0 deletions msal/src/main/java/com/microsoft/identity/client/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class Account implements IAccount {
private static final String TAG = Account.class.getSimpleName();

private final Map<String, ?> mIdTokenClaims;
private final String mRawIdToken;
private String mClientInfo;
private String mHomeOid;
private String mHomeTenantId;
Expand All @@ -53,8 +54,10 @@ public Account(

if (null != homeTenantIdToken) {
mIdTokenClaims = homeTenantIdToken.getTokenClaims();
mRawIdToken = homeTenantIdToken.getRawIDToken();
} else {
mIdTokenClaims = null;
mRawIdToken = null;
}
}

Expand Down Expand Up @@ -116,6 +119,12 @@ String getEnvironment() {
return mEnvironment;
}

@Nullable
@Override
public String getIdToken() {
return mRawIdToken;
}

/**
* Gets the claims associated to this Account's IdToken. In the case of the Microsoft Identity
* Platform, this value can be null if the home tenant has not been authorized.
Expand Down
12 changes: 12 additions & 0 deletions msal/src/main/java/com/microsoft/identity/client/IClaimable.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@

public interface IClaimable {

/**
* Gets the JWT format id_token corresponding to this IClaimable. This value conforms to
* <a href="https://tools.ietf.org/html/rfc7519">RFC-7519</a> and is further specified according
* to <a href="https://openid.net/specs/openid-connect-core-1_0.html#IDToken">OpenID Connect Core</a>.
* <p>
* Note: MSAL does not validate the JWT token.
*
* @return The raw id_token.
*/
@Nullable
String getIdToken();

/**
* Gets the claims associated with this IClaimable's IdToken.
*
Expand Down
2 changes: 1 addition & 1 deletion msal/versioning/version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Wed Aug 01 15:24:11 PDT 2018
versionName=1.0.1
versionName=1.1.0
versionCode=0

0 comments on commit c7daa6e

Please sign in to comment.