如何让用户在 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 中注册后返回登录页面? 的相关文章

  • 具有 .NET Core 3.0 的 Azure Web 应用程序失败:找不到 Microsoft.AspNetCore.App

    我们尝试在升级到 NET Core 3 0 后部署我们的 Web 应用程序 但它不断收到 服务不可用 消息 如果我们尝试运行dotnet来自捻角羚 dotnet webapp dll 我们得到以下错误 It was not possible
  • 无法使用 ASP.NET Core 从 JWT 令牌获取声明

    我正在尝试使用 ASP NET Core 实现 JWT 持有者身份验证的非常简单的实现 我从控制器返回的响应有点像这样 var identity new ClaimsIdentity identity AddClaim new Claim
  • 使用 Web API AuthorizeAttribute 角色的 Azure AD OAuth 客户端凭据授予流程

    Given 我们有 NET Web API 服务 它使用以下方式保护对控制器和操作的访问授权属性 https learn microsoft com en us dotnet api system web mvc authorizeattr
  • 费率计费计算

    Azure 价目表 API 返回 MeterRates 字段 请参阅文档 https msdn microsoft com en US library azure mt219004 aspx Azure 使用情况聚合给出了数量 请参阅文档
  • 如何识别 SQL Azure 中的死锁?

    我有一个由两个实例组成的 Windows Azure 角色 有时交易会失败并显示SqlException与以下文字 事务 进程 ID N 在锁资源上与另一个进程发生死锁 并被选为死锁牺牲品 重新运行事务 现在我已经谷歌搜索了一段时间并阅读这
  • Azure 发布包不包含所有文件

    我有几个配置 dll 和一个 exe 文件位于 bin 文件夹中并包含在项目中 文件设置为 内容 和 始终复制 当我在本地调试项目时 一切正常 问题是当我发布云服务时 文件丢失了 Azure 发布过程忽略了这些文件 并且部署包文件中也缺少这
  • 尝试了解天蓝色云服务中的负载平衡

    我正在维护一个天蓝色的云服务 它有 1 个 Web 角色和几个辅助角色 该网络角色有多个实例 当我从资源中打开云服务时 我可以看到服务端点和公共IP地址 我想了解这个蔚蓝云服务中的流量负载是如何平衡的 我搜索了负载均衡器 但在订阅中找不到它
  • Azure Graph API 身份验证_MissingOrMalformed

    我正在使用 Azure Graph API 从 Azure AD 导入用户 在天蓝色门户中 我添加了多个应用程序 我从 protal 获取 clientId tenantId 并创建一个有效期为一年的密钥 使用这些值 我创建一个 acces
  • 在azure中使用terraform为应用程序服务创建自动缩放规则时出错

    resource azurerm monitor autoscale setting test name AutoscaleSetting resource group name azurerm resource group main na
  • 如何在 Azure 逻辑应用中解析 Excel 电子表格

    我需要使用 Azure 逻辑应用从 Excel 电子表格中解析和提取列信息 我已经为我的逻辑应用程序设置了从 Outlook 检索最新未读电子邮件的功能 此外 我的逻辑应用程序执行 FOR EACH 来读取所有附件 来自未读电子邮件 并确保
  • Azure SQL 数据仓库 DWU 与 Azure SQL DTU

    我正在考虑从 Azure SQL 迁移到 Azure SQL 数据仓库 它似乎提供了我们需要的一些功能 但是价格是从小规模开始的一个问题 100 DWU 数据仓库的价格相当高 521 月 https azure microsoft com
  • 删除实例后,Azure 云服务变得无响应?

    我的 Azure 云服务 当它从 3 个实例缩减到 2 个实例时 我的网站会变得无响应几分钟 我的印象是 我的现有实例将保持不变 除了那些被删除的实例 并且我的网站将继续正常运行 我可能是错的 这是正常行为吗 当您从 2 个实例缩减到 1
  • Azure 表存储 - CreateIfNotExistsAsync 上的 501 NotImplemented

    我正在使用我知道可以工作的存储帐户和帐户密钥 信用 我有一个使用完全相同的连接字符串的 blob 容器 可以正常工作 我正在有效地这样做 CloudStorageAccount Parse connectionString CreateCl
  • 在 Windows 服务和 Azure WebJob 之间利用单一代码库的方法

    我正在开发一个定时重复流程 在某些情况下将部署在本地 而在其他情况下将部署在云 Azure 中 我正在研究 Windows 服务和 Azure WebJob 鉴于我只需要重复过程作为定时部分 我正在考虑将大量逻辑放在一个库中 只是本地部署的
  • 具有 blobfuse 或 Azure 存储 Blob 的 Azure 容器实例

    我正在从 azure 容器注册表 azure cli 和 或门户 部署到 azure 容器实例 Azure blobfuse 在 ubuntu 18 上 出现以下错误 未找到设备 请先尝试 modprobe fusion 解决这个问题的方法
  • Kubernetes - 尝试部署时“安装卷失败”

    我部署了第一个容器 我得到了信息 deployment apps frontarena ads deployment created 但后来我看到我的容器创建陷入等待状态 然后我看到日志使用kubectl describe pod fron
  • 如何使现有 ARM 模板上的资源 API 版本保持最新?

    我有一个现有的 Azure 模板 它配置以下资源 Microsoft ClassicStorage StorageAccounts api version 2014 06 01 microsoft insights components a
  • 在 Service Fabric 应用程序中动态创建服务

    这有点描述性 所以请耐心等待 在我尝试构建的应用程序中 产品具有独特的功能 用户可以选择选择功能 A B D 但不能选择 C 我构建此功能的方式是 每个不同的功能都是一个服务 无状态 我正在考虑将数据存储在 Azure SQL 中 数据库并
  • 任何人都可以帮助我如何通过 vsts 停止和启动 azure webjobs?

    我在 VSTS 中找到了一个插件 azure app service webjob start 但我无法启动 停止 webjob 请帮助我 在 VSTS 中运行任务时出现以下错误 Error 2017 09 25T12 26 37 3203
  • Azure 共享计划上的 SSL?

    我有 1 个网站 1 个数据库和 1 个 SSL 托管在 azure 上 我曾经拥有 基本 托管套餐 但每个月要支付 70 美元才能获得基本设置 并且所有内容都具有最小的缩放比例 我意识到我的低流量站点不需要专用计算机 因此我尝试转向共享计

随机推荐

  • 线程只运行一次

    当线程完成后 您无法使用 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 会话管理器 但它不起作用 有