Skip to content

Commit

Permalink
Util method to check if sign in with google flow (#2596)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitc1 authored Feb 28, 2025
1 parent d9f357b commit 6676be0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package com.microsoft.identity.common.internal.msafederation

import com.microsoft.identity.common.internal.msafederation.google.SignInWithGoogleCredential
import com.microsoft.identity.common.java.commands.parameters.BrokerInteractiveTokenCommandParameters
import java.util.AbstractMap

/**
Expand All @@ -39,3 +40,10 @@ fun SignInWithGoogleCredential.getIdProviderHeadersForAuthorization(): Map<Strin
fun SignInWithGoogleCredential.getIdProviderExtraQueryParamForAuthorization(): Map.Entry<String, String> {
return AbstractMap.SimpleEntry(MsaFederationConstants.MSA_ID_PROVIDER_EXTRA_QUERY_PARAM_KEY, signInProviderName.getIdProviderName())
}

/**
* Helper/Extension method to check if the interactive flow is using Sign-in With Google.
*/
fun BrokerInteractiveTokenCommandParameters.isSignInWithGoogleFlow(): Boolean {
return this.requestHeaders?.containsKey(MsaFederationConstants.MSA_ID_TOKEN_HEADER_KEY) ?: false
}

0 comments on commit 6676be0

Please sign in to comment.