Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class AcquireTokenParameters extends TokenParameters {
private Activity mActivity;
private Fragment mFragment;
private String mLoginHint;
private String mDomainHint;
private Prompt mPrompt;
private List<String> mExtraScopesToConsent;
private List<Map.Entry<String, String>> mExtraQueryStringParameters;
Expand All @@ -53,6 +54,7 @@ public AcquireTokenParameters(AcquireTokenParameters.Builder builder) {
mActivity = builder.mActivity;
mFragment = builder.mFragment;
mLoginHint = builder.mLoginHint;
mDomainHint = builder.mDomainHint;
mPreferredAuthMethod = builder.mPreferredAuthMethod;
mPrompt = builder.mPrompt;
mExtraScopesToConsent = builder.mExtraScopesToConsent;
Expand Down Expand Up @@ -92,6 +94,24 @@ void setLoginHint(String loginHint) {
this.mLoginHint = loginHint;
}

/**
* Optional. Gets the domain hint sent along with the authorization request.
*
* @return
*/
public String getDomainHint() {
return mDomainHint;
}

/**
* Sets the domain hint sent along with the authorization request.
*
* @param domainHint
*/
void setDomainHint(String domainHint) {
this.mDomainHint = domainHint;
}

/**
* Gets the preferred authentication method sent along with the authorization request.
* @return The preferred authentication method or null if not set.
Expand Down Expand Up @@ -152,7 +172,7 @@ public static class Builder extends TokenParameters.Builder<AcquireTokenParamete
private Activity mActivity;
private Fragment mFragment;
private String mLoginHint;

private String mDomainHint;
private PreferredAuthMethod mPreferredAuthMethod;
private Prompt mPrompt;
private List<String> mExtraScopesToConsent;
Expand All @@ -174,6 +194,11 @@ public AcquireTokenParameters.Builder withLoginHint(String loginHint) {
return self();
}

public AcquireTokenParameters.Builder withDomainHint(String domainHint) {
mDomainHint = domainHint;
return self();
}

@Nullable
public AcquireTokenParameters.Builder withPreferredAuthMethod(final PreferredAuthMethod preferredAuthMethod) {
mPreferredAuthMethod = preferredAuthMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public static InteractiveTokenCommandParameters createInteractiveTokenCommandPar
parameters.getExtraQueryStringParameters(),
configuration))
.loginHint(getLoginHint(parameters))
.domainHint(getDomainHint(parameters))
.account(parameters.getAccountRecord())
.authenticationScheme(authenticationScheme)
.authorizationAgent(getAuthorizationAgent(configuration))
Expand Down Expand Up @@ -1284,6 +1285,10 @@ private static String getLoginHint(@NonNull final AcquireTokenParameters paramet
}
}

private static String getDomainHint(@NonNull final AcquireTokenParameters parameters) {
return parameters.getDomainHint();
}

private static AuthorizationAgent getAuthorizationAgent(@NonNull final PublicClientApplicationConfiguration configuration) {
if (configuration.getAuthorizationAgent() != null) {
return configuration.getAuthorizationAgent();
Expand Down
Loading