Skip to content

Commit

Permalink
Transfer token redemption changes (#2399)
Browse files Browse the repository at this point in the history
  • Loading branch information
somalaya authored May 24, 2024
1 parent ea869b0 commit 75ce1ad
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ private ErrorStrings() {
*/
public static final String KEY_NOT_FOUND = "key_not_found";

/**
* Restore MSA account using transfer token failed.
*/
public static final String RESTORE_MSA_ACCOUNT_WITH_TRANSFER_TOKEN = "restore_msa_accounts_failed";

/**
* AccountMode in configuration is set to multiple. However, the device is marked as shared (which requires single account mode).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ public enum SpanName {
BrokerSelectionProtocolManager,
BrokerDiscoveryV1ProtocolBroadcastResult,
Fido,
BrokerAccountServiceRemoveAccounts
BrokerAccountServiceRemoveAccounts,
AcquirePRTUsingTransferToken
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class MicrosoftTokenRequest extends TokenRequest implements IHasExtraPara
public static final String MICROSOFT_ENROLLMENT_ID = "microsoft_enrollment_id";
public static final String DEVICE_CODE = "device_code";

public static final String TRANSFER_TOKEN = "transfer_token";

public MicrosoftTokenRequest() {
mClientInfoEnabled = "1";
}
Expand Down Expand Up @@ -95,6 +97,10 @@ public MicrosoftTokenRequest() {
@SerializedName(DEVICE_CODE)
private String mDeviceCode;

@Expose()
@SerializedName(TRANSFER_TOKEN)
private String mTransferToken;

private String mTokenScope;

// Sent as part of headers if available, so marking it transient.
Expand Down Expand Up @@ -206,4 +212,13 @@ public String getDeviceCode() {
public void setDeviceCode(final String deviceCode) {
this.mDeviceCode = deviceCode;
}

@Nullable
public String getTransferToken() {
return mTransferToken;
}

public void setTransferToken(final String transferToken) {
this.mTransferToken = transferToken;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* A class holding the state of the Token Request (oAuth2).
* OAuth2 Spec: https://tools.ietf.org/html/rfc6749#section-4.1.3
* OAuth2 Client Authentication: https://tools.ietf.org/html/rfc7521#section-4.2
* This should include all fo the required parameters of the token request for oAuth2
* This should include all of the required parameters of the token request for oAuth2
* This should provide an extension point for additional parameters to be set
* <p>
* Includes support for client assertions per the specs:
Expand Down Expand Up @@ -304,6 +304,7 @@ public static class GrantTypes {
// The grant type is used when token request contains a JWT
// e.g. used in Primary Refresh Token acquisition flows
public static final String JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer";
public static final String TRANSFER_TOKEN = "transfer_token";
}

public static class TokenType {
Expand Down

0 comments on commit 75ce1ad

Please sign in to comment.