如何让用户在 Azure AD B2C 中注册后返回登录页面?

2024-02-23

当用户在系统中注册时,他会自动重定向到我们的应用程序作为登录用户。我希望在注册后,他会被重定向到签名页面。我想要这种行为,因为用户在访问系统之前需要得到管理员的批准。我使用自定义策略。

我尝试使用“SM-Noop”会话管理器,但它不起作用。有我的代码:

<!--Local account sign-up page-->
    <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
        <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
        <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
        <OutputClaim ClaimTypeReferenceId="mobile" />
        <OutputClaim ClaimTypeReferenceId="extension_phoneExtension" />
        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surName" />
        <OutputClaim ClaimTypeReferenceId="extension_company" />
        <OutputClaim ClaimTypeReferenceId="streetAddress" />
        <OutputClaim ClaimTypeReferenceId="city" />
        <OutputClaim ClaimTypeReferenceId="state" />
        <OutputClaim ClaimTypeReferenceId="country" />
        <OutputClaim ClaimTypeReferenceId="postalcode" />
      </OutputClaims>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
    </TechnicalProfile>

Edit1:解决方案似乎是添加orchestrationSteps。有一个链接可以做到这一点,但需要重置密码:www.stackoverflow.com/a/62878136 http://www.stackoverflow.com/a/62878136就我而言,它不起作用,因为我无法在同一个 userJourney 中添加两个CombinedSignInAndSignUp,因此它崩溃了。还有其他想法吗?

Edit2:我的 SignUpSignIn 政策如下:

 <UserJourney Id="SignUpOrSignIn">
  <OrchestrationSteps>

    <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
      <ClaimsProviderSelections>
        <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
      </ClaimsProviderSelections>
      <ClaimsExchanges>
        <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
      </ClaimsExchanges>
    </OrchestrationStep>

    <OrchestrationStep Order="2" Type="ClaimsExchange">
      <Preconditions>
        <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
          <Value>objectId</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
      </Preconditions>
      <ClaimsExchanges>
        <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
      </ClaimsExchanges>
    </OrchestrationStep>

    <!-- This step reads any user attributes that we may not have received when in the token. -->
    <OrchestrationStep Order="3" Type="ClaimsExchange">
      <ClaimsExchanges>
        <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
      </ClaimsExchanges>
    </OrchestrationStep>

    <OrchestrationStep Order="4" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />

  </OrchestrationSteps>
  <ClientDefinition ReferenceId="DefaultWeb" />
</UserJourney>

仍在尝试找出在我的 TrustFrameworkExtensions.xml 中放入 Order="5" 等的内容


以下是您可以执行的配置:

声明类型(从B2C端打印消息)

<ClaimType Id="userMessage">
        <DisplayName></DisplayName>
        <DataType>string</DataType>
        <UserInputType>Paragraph</UserInputType>
    </ClaimType>

索赔转换

<ClaimsTransformation Id="GetUserMessage" TransformationMethod="CreateStringClaim">
        <InputParameters>
            <InputParameter Id="value" DataType="string" Value="[![Your Account has been successfully created. To continue click on the sign-in link below.][1]][1]" />
        </InputParameters>
        <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="userMessage" TransformationClaimType="createdClaim" />
        </OutputClaims>
    </ClaimsTransformation>

技术简介:

<TechnicalProfile Id="SelfAsserted-UserMessage">
      <DisplayName>After Registration</DisplayName>
      <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <Metadata>
        <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
        <!--Demo: hide the continue and cancel buttons -->
        <Item Key="setting.showContinueButton">false</Item>
        <Item Key="setting.showCancelButton">false</Item>
      </Metadata>
      <InputClaimsTransformations>
        <InputClaimsTransformation ReferenceId="GetUserMessage" />
      </InputClaimsTransformations>
      <InputClaims>
         <InputClaim ClaimTypeReferenceId="userMessage" />
      </InputClaims>
      <OutputClaims>
        <!--Demo: Show the paragraph claim with the message to the user -->
        <OutputClaim ClaimTypeReferenceId="userMessage" />
      </OutputClaims>
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
    </TechnicalProfile>

用户旅程:

<OrchestrationStep Order="3" Type="ClaimsExchange">
      <ClaimsExchanges>
        <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
      </ClaimsExchanges>
    </OrchestrationStep>
    <OrchestrationStep Order="4" Type="ClaimsExchange">
    <Preconditions>
        <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
          <Value>extension_isApproved</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
         <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
          <Value>extension_isApproved</Value>
          <Value>True</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
      </Preconditions>
      <ClaimsExchanges>
        <ClaimsExchange Id="SendClaims" TechnicalProfileReferenceId="SelfAsserted-UserMessage" />
      </ClaimsExchanges>
    </OrchestrationStep>
    <OrchestrationStep Order="5" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
    </OrchestrationSteps>

Note:确保在“AAD-UserReadUsingObjectId“您添加以下声明:

<OutputClaim ClaimTypeReferenceId="extension_isApproved" />

也在《自断言用户消息“配置文件,在内容定义中你可以有自定义页面其中将包含您的登录页面的链接。下面是默认情况下的屏幕截图。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何让用户在 Azure AD B2C 中注册后返回登录页面? 的相关文章

随机推荐

  • 线程只运行一次

    当线程完成后 您无法使用 start 方法再次运行它 它会抛出异常 谁能解释一下 为什么 这样的架构决策背后的原因是什么 因为在单独的线程中执行代码的方法不是创建一个线程 这与什么是线程的系统视图相关 关于绿色线程和系统线程之间的区别有无穷
  • 防止刷新时插入重复记录而不重定向

    我有这样的脚本 if isset POST comment posted user comment mysql real escape string POST user comment add user comment Event addU
  • 如何获取Unity中正在注入的对象的类型?

    我有一个类型在其构造函数中接收另一个类型 该类型通常是创建它的对象的类型 例如 public class Logger public Logger Type parent 我想指示Unity解决Logger将需要它的对象的类型作为参数传递给
  • WCF Rest 4.0 中不带尾部斜杠的简单 URL 路由

    我有一个基于 WCF REST 服务模板 40 CS 的 WCF REST 4 0 项目 我想公开简单的服务端点 URLwithout尾部斜杠 例如 CarService cs http www domain com cars http w
  • 工具箱 Visual Studio 2015 中缺少报告查看器标记

    我最近安装了 Visual Studio 2015 Community 现在我的工具箱没有报表查看器标签 我的 ASP NET 项目中所有现有的报表查看器都显示 创建控件时出错 我已经检查了所有参考文献 它们似乎没问题 当我运行项目时 报告
  • 如何使用 swt 向表中添加行

    我正在学习 swing 并对将行插入到表格有一个疑问 我的要求是我必须通过按添加按钮添加新行 但我无法继续 请找到下面的代码 如果有人知道请帮助我 public class TableShellExample Display d Shell
  • 如何计算sklearn中交叉验证的每个模型中的特征重要性

    我在用RandomForestClassifier with 10 fold cross validation如下 clf RandomForestClassifier random state 42 class weight balanc
  • 如何在车把模板中使用 {{{{raw-helper}}}}

    我有一个效果很好的车把模板 我希望能够将以下内容放入其中 这显然会在处理车把文件时呈现 所有的 最终都是空白的 这不好 我找到了 raw helper 块助手 并像这样尝试 raw helper
  • 按比例随机将 NA 插入到数据帧中

    我有一个完整的数据框 我希望将数据框中 20 的值替换为 NA 以模拟随机缺失数据 A lt c 1 10 B lt c 11 20 C lt c 21 30 df lt data frame A B C 谁能建议一种快速的方法来做到这一点
  • 获取最大值之前的值

    例如 给定这个稀疏 id 表 id 1 2 3 6 7 我可以使用以下查询从表中获取最高的 id SELECT max id FROM Comics I get id 7 如何获取最高 id 之前的 id 即使值不连续 一般来说 您可以首先
  • VSTO 写入 Excel 中的单元格!

    为什么这有效 Excel Worksheet Application ActiveSheet get Range A1 A1 Value2 text 但这并没有 Excel Worksheet activeSheet Excel Works
  • 泛型作为方法返回类型

    我在 StackOverflow 上四处寻找我面临的问题的答案 我遇到了很多好的答案 但仍然没有回答我的问题 Java中通过反射获取泛型参数的类型 https stackoverflow com questions 1901164 get
  • 在discord.py中添加角色

    我尝试了许多不同的方法 并在 youtube 上进行了搜索 但我尝试的所有方法都不起作用 已过时或不相关 如何向提到的用户添加角色 这就是我的代码 你看 最后我在 里写的 client command commands has permis
  • 根据用户权限隐藏/禁用 GUI 元素的最佳方法?

    我正在启动一个 Web 应用程序 其客户端在纯 ExtJS 中实现 中间层在 Grails 中实现 该应用程序具有基于角色的授权 其中用户可以拥有许多细粒度的角色 例如 SOME FORM READ SOME FORM UPDATE SOM
  • Perforce:p4 集与 p4 信息

    我最近开始在 Windows 7 上使用 perforce 我使用 P4V 在我的本地计算机上同步了 perforce 我试图运行一些其他工具 该工具使用我的 perforce 本地目录映射到我的计算机上的路径 看来它捡错了 在尝试调试时
  • org.springframework.web.client.ResourceAccessException:微服务中的 GET 请求出现 I/O 错误

    我正在从链接开发微服务代码 https github com sivaprasadreddy spring boot microservices series https github com sivaprasadreddy spring
  • 如何删除 VBA/Excel 中 X 行下方的所有内容?

    我有一个包含数字的长变量 X 说是415 如何删除工作表中第 415 行及以下行的所有内容 我想确保电子表格的第 415 行及其下方的任何其他内容都是干净的 我该怎么做呢 谢谢 听起来像下面的内容会满足您的需求 With Sheets Sh
  • Javers - 使用 Javers 代替 Envers 的优点是什么?

    我正在使用 Spring Data REST 开发 RESTful API 现在对于审计 Spring 确实可以选择审计元数据 例如created date and modified date但他们不提供实体版本控制 目前实体版本有两个流行
  • 向结构化numpy数组添加字段(4)

    之前已经解决过这个问题 here https stackoverflow com questions 21413947 adding a field to a structured numpy array 3 here https stac
  • 如何让用户在 Azure AD B2C 中注册后返回登录页面?

    当用户在系统中注册时 他会自动重定向到我们的应用程序作为登录用户 我希望在注册后 他会被重定向到签名页面 我想要这种行为 因为用户在访问系统之前需要得到管理员的批准 我使用自定义策略 我尝试使用 SM Noop 会话管理器 但它不起作用 有