azure-ad-b2c / samples

Azure AD B2C custom policy solutions and samples.
831 stars 596 forks source link

Custom policy #181

Open yogirajdeshpande opened 3 years ago

yogirajdeshpande commented 3 years ago

HI, I want to redirect user to custom page after immediate sign in (this new custom page will have continue button and some html controls like dropdown where use can select value) on this continue click it should redirect back to application with all claims including 2nd page value which is selected in dropdown.

In short flow should be Application -- > Login --> redirect to ad B2C login page (custom page stored in blob storage) -->login success --> redirect to 2nd page(configured using azure and stored in blob storage)-->selects dropdown and clicks continue --->redirect to application call back url with all claims..

Can you please help ???

BradCandell commented 3 years ago

You should just need another Self Asserted technical profile in your policy and journey.

yogirajdeshpande commented 3 years ago

Thank You Brad.. But can you explain in detail as i have not done anything like this before. I have created custom policy and uploaded xml's. in extension.xml I have updated Loaduri with my sign in page blob storage url now on successful login it is redirecting to my application in xml what needs to be added or updated.. I am pasting extension xml here. I have changed url of <?xml version="1.0" encoding="utf-8" ?> <TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0" TenantId=".onmicrosoft.com" PolicyId="B2C_1A_TrustFrameworkExtensions" PublicPolicyUri="http://.onmicrosoft.com/B2C_1A_TrustFrameworkExtensions">

.onmicrosoft.com B2C_1A_TrustFrameworkBase ~/tenant/templates/AzureBlue/exception.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:globalexception:1.1.0 Error page ~/tenant/templates/AzureBlue/idpSelector.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:idpselection:1.0.0 Idp selection page Sign in ~/tenant/templates/AzureBlue/idpSelector.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:idpselection:1.0.0 Idp selection page Sign up https://adcustomlogin.blob.core.windows.net/adblobcontainer/ocean_blue/unified.html ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0 Signin and Signup ~/tenant/templates/AzureBlue/selfAsserted.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0 Collect information from user page ~/tenant/templates/AzureBlue/selfAsserted.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0 Collect information from user page ~/tenant/templates/AzureBlue/selfAsserted.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0 Local account sign up page ~/tenant/templates/AzureBlue/selfAsserted.cshtml ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0 Local account change password page Local Account SignIn a19f4fc2-bc8b-4968-a4f7-8cdbd4a5dabc 493e62bc-6164-4cbf-983f-6c4c7f54cfb0
<!--UserJourneys>

</UserJourneys-->

BradCandell commented 3 years ago

Thank you @yogirajdeshpande - Once a person makes the leap from User Flows to Custom Policies, it is normal to be a bit intimidated. I recommend that you start with Microsoft's documentation on Getting Started with Custom Policies.

In addition, some things that helped me jump over that learning barrier:

At the end of the day, you will need multiple Self Asserted profiles that will display and collect the information in claims.

I will try to put together a sample at some point, but I cannot currently commit to a timeframe on that.

BradCandell commented 3 years ago

@yogirajdeshpande - One sample in particular that might be helpful, would be here:

https://github.com/azure-ad-b2c/samples/tree/master/policies/progressive-profile