简体   繁体   中英

How to appy string transformation for azure b2c idp url usin claim resolver

Use case : As a developer i want to to extract the redirect_uri from the b2c idp url and then apply claim transformation preferably a string one to extract certain information and use that to build the loadURi under content definition and display the html pages dynamically

Below is the b2c idp url https://something.b2clogin.com/something.onmicrosoft.com/B2C_1A_Signup_Signin/oauth2/v2.0/authorize?response_type=id_token&scope=openid%20profile&client_id=some_id&redirect_uri=https%3A%2F%2Fsomething.somedomain.com&state=somestate0%3D&nonce=some_id&client_info=1&x-client-SKU=MSAL.JS&x-client-Ver=1.4.4&client-request-id=some_client_request_id&response_mode=fragment

From the above redirect_uri = https://something.somedomain.com-- using a claim transformation i want to extract somedomain

  1. make the call to the parameter in the relying party.xml as below
    <DefaultUserJourney ReferenceId="SignUpOrSignIn" />
    <UserJourneyBehaviors>
      <ContentDefinitionParameters>
        <Parameter Name="redirect_uri">{OIDC:RedirectUri}</Parameter>
    </ContentDefinitionParameters>```
 
 

 Build the LoadUri in contentdefinition of api.selfasserted
 ```<ContentDefinition Id="api.selfasserted">
        <LoadUri>https://somestoragaccount/{OIDC:RedirectUri}/unified.html</LoadUri>
        <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
        <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.0.0</DataUri>
        <Metadata>
          <Item Key="DisplayName">Collect information from user page</Item>
        </Metadata>
      </ContentDefinition>```


• I would suggest you to please refer to the string claims transformations as stated in the below document as described for your reference: -

https://docs.microsoft.com/en-us/azure/active-directory-b2c/string-transformations

In that, the string comparison, claims transformation, change case, comparison and other scenarios are explained in detail.

Also, refer to the below claim resolver documentation link that explains the various parameters to be included in the technical profile for direct sign-in and other scenarios: -

https://docs.microsoft.com/en-us/azure/active-directory-b2c/claim-resolver-overview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM