-
Notifications
You must be signed in to change notification settings - Fork 46
getAllSsoTokens method for Edge, Fixes AB#3361797 #2774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
b6554db
2f0a552
8483335
d274164
0be1039
71220cf
25e14f3
4ecb0e6
978189e
c3abb49
230ea15
ebd83e4
ae0a0b8
053ebe0
253a305
36d2e73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,6 +232,24 @@ public BrokerRequest brokerRequestFromSilentOperationParameters(@NonNull final S | |
| return requestBundle; | ||
| } | ||
|
|
||
| public Bundle getRequestBundleForAllSsoTokens( | ||
| @NonNull final AcquirePrtSsoTokenCommandParameters parameters, | ||
| @NonNull final String negotiatedBrokerProtocolVersion) { | ||
|
||
|
|
||
| final Bundle bundle = new Bundle(); | ||
| bundle.putString(AuthenticationConstants.Broker.NEGOTIATED_BP_VERSION_KEY, negotiatedBrokerProtocolVersion); | ||
| if (parameters.getRequestAuthority() != null) { | ||
| bundle.putString(AuthenticationConstants.Broker.REQUEST_AUTHORITY, parameters.getRequestAuthority()); | ||
| } | ||
| if (parameters.getSsoUrl() != null) { | ||
| bundle.putString(AuthenticationConstants.Broker.BROKER_SSO_URL_KEY, parameters.getSsoUrl()); | ||
| } | ||
| if (parameters.getCorrelationId() != null) { | ||
| bundle.putString(AuthenticationConstants.Broker.ACCOUNT_CORRELATIONID, parameters.getCorrelationId()); | ||
| } | ||
melissaahn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return bundle; | ||
| } | ||
|
|
||
| /** | ||
| * Method to construct a request bundle for broker hello request. | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // All rights reserved. | ||
| // | ||
| // This code is licensed under the MIT License. | ||
| // | ||
| // Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| // of this software and associated documentation files(the "Software"), to deal | ||
| // in the Software without restriction, including without limitation the rights | ||
| // to use, copy, modify, merge, publish, distribute, sublicense, and / or sell | ||
| // copies of the Software, and to permit persons to whom the Software is | ||
| // furnished to do so, subject to the following conditions : | ||
| // | ||
| // The above copyright notice and this permission notice shall be included in | ||
| // all copies or substantial portions of the Software. | ||
| // | ||
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| // THE SOFTWARE. | ||
| package com.microsoft.identity.common.java.commands; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| import edu.umd.cs.findbugs.annotations.Nullable; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NonNull; | ||
| import lombok.experimental.Accessors; | ||
|
|
||
| /** | ||
| * A DTO for the results of a batch AcquirePrtSsoToken request. | ||
| */ | ||
| @Builder | ||
| @Getter | ||
| @Accessors(prefix = "m") | ||
| public class AcquirePrtSsoTokenBatchResult { | ||
melissaahn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * List of successful per-account results keyed by home account id. | ||
melissaahn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| @SerializedName("results") | ||
| private final @NonNull List<AcquirePrtSsoTokenResult> mResults; | ||
|
|
||
| /** | ||
| * Map of failed accounts keyed by home account id with error message/code. | ||
| * (Only include accounts that did not produce a full result object.) | ||
| */ | ||
| @SerializedName("failedAccounts") | ||
| private final @Nullable Map<String, String> mFailedAccounts; | ||
|
|
||
| /** | ||
| * Optional top-level error. | ||
| */ | ||
| @SerializedName("error") | ||
| private final @Nullable String mError; | ||
|
|
||
| /** | ||
| * Correlation id for diagnostics. | ||
| */ | ||
| @SerializedName("correlationId") | ||
| private final @Nullable String mCorrelationId; | ||
|
|
||
| /** | ||
| * Authority used for the request. | ||
| */ | ||
| @SerializedName("authority") | ||
| private final @Nullable String mAuthority; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,4 +89,10 @@ public class AcquirePrtSsoTokenResult { | |
| @SerializedName("telemetry") | ||
| private final @NonNull Map<String, Object> mTelemetry; | ||
|
|
||
| /** | ||
| * The time when the token was acquired, in milliseconds since epoch. | ||
| */ | ||
| @SerializedName("AcquisitionTimeMillis") | ||
melissaahn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| private final @Nullable Long mAcquisitionTimeMillis; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my understanding, supposing a client with an older MSAL version calls the getSsoToken method, their version of AcquirePrtSsoTokenResult won't have this mAcquisitionTimeMillis, but GSON should be ignoring any parameters which they don't recognize, and thus shouldn't throw an exception or cause a crash. |
||
|
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.