Skip to content

Commit c7daa6e

Browse files
author
Brian Melton-Grace
authored
Exposes id_token via AuthenticationResult (#870) (#871)
* Re #850 * Rev version number -> 1.1.0 * Update changelog for 1.1.0 * Improving javadoc
1 parent e3d5403 commit c7daa6e

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
MSAL Wiki : https://github.com/AzureAD/microsoft-authentication-library-for-android/wiki
2+
3+
Version 1.1.0
4+
----------------------------
5+
- Expose id_token (raw) via IAccount/ITenantProfile from AuthenticationResult (#850)
6+
27
Version 1.0.1
38
----------------------------
49
- Fix issue #785, #786, #805, #806, #807, #816, #828, #855, #859

msal/src/main/java/com/microsoft/identity/client/Account.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class Account implements IAccount {
4141
private static final String TAG = Account.class.getSimpleName();
4242

4343
private final Map<String, ?> mIdTokenClaims;
44+
private final String mRawIdToken;
4445
private String mClientInfo;
4546
private String mHomeOid;
4647
private String mHomeTenantId;
@@ -53,8 +54,10 @@ public Account(
5354

5455
if (null != homeTenantIdToken) {
5556
mIdTokenClaims = homeTenantIdToken.getTokenClaims();
57+
mRawIdToken = homeTenantIdToken.getRawIDToken();
5658
} else {
5759
mIdTokenClaims = null;
60+
mRawIdToken = null;
5861
}
5962
}
6063

@@ -116,6 +119,12 @@ String getEnvironment() {
116119
return mEnvironment;
117120
}
118121

122+
@Nullable
123+
@Override
124+
public String getIdToken() {
125+
return mRawIdToken;
126+
}
127+
119128
/**
120129
* Gets the claims associated to this Account's IdToken. In the case of the Microsoft Identity
121130
* Platform, this value can be null if the home tenant has not been authorized.

msal/src/main/java/com/microsoft/identity/client/IClaimable.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929

3030
public interface IClaimable {
3131

32+
/**
33+
* Gets the JWT format id_token corresponding to this IClaimable. This value conforms to
34+
* <a href="https://tools.ietf.org/html/rfc7519">RFC-7519</a> and is further specified according
35+
* to <a href="https://openid.net/specs/openid-connect-core-1_0.html#IDToken">OpenID Connect Core</a>.
36+
* <p>
37+
* Note: MSAL does not validate the JWT token.
38+
*
39+
* @return The raw id_token.
40+
*/
41+
@Nullable
42+
String getIdToken();
43+
3244
/**
3345
* Gets the claims associated with this IClaimable's IdToken.
3446
*

msal/versioning/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#Wed Aug 01 15:24:11 PDT 2018
2-
versionName=1.0.1
2+
versionName=1.1.0
33
versionCode=0

0 commit comments

Comments
 (0)