2017-10-18 53 views
2

我已經設置了Azure B2C租戶並使用自定義政策將azure廣告添加爲IDP,以便用戶可以使用其域帳戶註冊。我可以建立一個自定義頁面,向他們詢問他們的電子郵件,然後將他們重定向到適當的政策(一個用於工作域帳戶,另一個用於個人電子郵件),以便他們不必在工作電子郵件和個人電子郵件之間進行選擇。問題是我不想讓用戶再次輸入電子郵件。有沒有辦法做到這一點?我基本上想要實現類似於Azure AD的通用端點爲所有帳戶所做的事情。如何將電子郵件包含在重定向到Azure AD B2C

+0

什麼樣的政策?登錄支持'&username = myUsername'。 [Source](https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/14786559-pre-populate-username-field-with-value-from-the-qu) – spottedmahn

+0

還有另一種選擇但它需要更多的工作。 [見這裏](https://stackoverflow.com/questions/46380468/azure-ad-b2c-pre-populate-a-custom-attribute-in-the-signup-policy) – spottedmahn

+0

@spottedmahn註冊/登錄。I嘗試這 notification.ProtocolMessage.IssuerAddress + =「&username = example」;在OnRedirectToIdentityProvider事件中,但它不起作用。仍然要求我選擇idp和用戶名 – Juxhin

回答

1

對於自定義策略,如果將「login_hint」查詢字符串參數添加到OpenID Connect身份驗證請求,則可以通過向「signInName」輸入添加「DefaultValue」屬性來將登錄字段默認爲此登錄提示權利要求爲「SelfAsserted-LocalAccountSignin-電子郵件」技術簡介如下:

<TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Email"> 
    <DisplayName>Local Account Signin</DisplayName> 
    ... 
    <InputClaims> 
    <InputClaim ClaimTypeReferenceId="signInName" DefaultValue="{OIDC:LoginHint}" /> 
    </InputClaims> 
    <OutputClaims> 
    <OutputClaim ClaimTypeReferenceId="signInName" Required="true" /> 
    ... 
    </OutputClaims> 
    ... 
</TechnicalProfile> 

的「默認值」屬性引用權利要求解析器,用於設置「signInName」權利要求類型到的OpenID的「login_hint」參數連接驗證請求。

+0

這工作。謝謝@ChrisPadgett – Juxhin

相關問題