我已经成功创建了一个 AAD B2C 自定义策略,它调用了我的应用程序。
类似于可以在这里找到的内容:
在 Azure AD B2C 用户旅程中集成 REST API 声明交换作为对用户输入的验证
和这里:
<ClaimsProvider>
<DisplayName>XYZ API</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="XYZ">
<DisplayName>XYZ</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ServiceUrl">https://example.com/api/1.0/Users</Item>
<Item Key="AuthenticationType">ClientCertificate</Item>
<Item Key="SendClaimsIn">Body</Item>
</Metadata>
<CryptographicKeys>
<Key Id="ClientCertificate" StorageReferenceId="B2C_1A_XYZRestClientCertificate" />
</CryptographicKeys>
<InputClaims>
<InputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="givenName" />
<InputClaim ClaimTypeReferenceId="surname" PartnerClaimType="surname" />
<InputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="displayName" />
<InputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="objectId" />
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" />
<InputClaim ClaimTypeReferenceId="otherMails" PartnerClaimType="otherMails" />
</InputClaims>
<OutputClaims>
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider> …
Run Code Online (Sandbox Code Playgroud) 我们有一个 SpringBoot 应用程序,并使用 Jersey 来审核传入的 HTTP 请求。
我们实现了 Jersey ContainerRequestFilter来检索传入的HttpServletRequest 并使用 HttpServletRequest 的getParameterMap()方法来提取查询和表单数据并将其放入我们的审核中。
这与 getParameterMap() 的 javadoc 一致:
“请求参数是随请求发送的额外信息。对于 HTTP servlet,参数包含在查询字符串或发布的表单数据中。”
这是与过滤器相关的文档:
更新SpringBoot后,我们发现getParameterMap()不再返回表单数据,但仍然返回查询数据。
我们发现 SpringBoot 2.1 是支持我们代码的最后一个版本。在 SpringBoot 2.2 中,Jersey 的版本更新为 2.29,但在查看发行说明后,我们没有看到任何与此相关的内容。
发生了什么变化?我们需要改变什么来支持 SpringBoot 2.2 / Jersey 2.29?
这是我们代码的简化版本:
JerseyRequestFilter - 我们的过滤器
import javax.annotation.Priority;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Priorities;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.ResourceInfo;
import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;
...
@Provider
@Priority(Priorities.AUTHORIZATION)
public class JerseyRequestFilter implements ContainerRequestFilter {
@Context
private ResourceInfo resourceInfo;
@Context
private …
Run Code Online (Sandbox Code Playgroud) 我们希望在azure ad b2c目录中查询用户,并以编程方式为所有类型的用户提取登录电子邮件.我们理解为:
使用azure广告图表资源管理器运行api调用时:
https://graph.windows.net/myorganization/users?api-version=1.6
Run Code Online (Sandbox Code Playgroud)
我们可以看到所有这些用户.(数据有点消毒)
示例标准用户
{
"odata.type": "Microsoft.DirectoryServices.User",
"objectType": "User",
"objectId": "8b7c468b-fec4-4ff2-b448-64f99f3fa9ff",
"deletionTimestamp": null,
"accountEnabled": true,
"assignedLicenses": [],
"assignedPlans": [],
"city": null,
"companyName": null,
"country": null,
"creationType": null,
"department": null,
"dirSyncEnabled": null,
"displayName": "Global User",
"employeeId": null,
"facsimileTelephoneNumber": null,
"givenName": null,
"immutableId": null,
"isCompromised": null,
"jobTitle": null,
"lastDirSyncTime": null,
"mail": null,
"mailNickname": "global.user",
"mobile": null,
"onPremisesDistinguishedName": null,
"onPremisesSecurityIdentifier": null,
"otherMails": [],
"passwordPolicies": null,
"passwordProfile": null,
"physicalDeliveryOfficeName": null,
"postalCode": null,
"preferredLanguage": null,
"provisionedPlans": [],
"provisioningErrors": …
Run Code Online (Sandbox Code Playgroud) 我在此处遵循了"入门"工作流程:https: //docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-get-started-custom
我从头开始跟踪它,两次,并且尝试使用登录和注册自定义策略登录时都会出现"我的密码不正确"的提示.我该如何正确认证?
工作的事情:
使用Application Insights我可以看到以下错误.(适用一些卫生设施)
"ValidationRequest":{
"ContentType":"Unspecified",
"Created":"2017-10-06T17:19:34.3995426Z",
"Key":"ValidationRequest",
"Persistent":true,
"Value":"client_id=55555555-5555-5555-5555-555555555555&resource=cccccccc-cccc-cccc-cccc-cccccccccccc&username=MYUSERNAME&password=PASSWORDIENTEREDONSCREEN&grant_type=password&scope=openid&nca=1;1;login-NonInteractive;False"
},
"ValidationResponse":{
"ContentType":"Json",
"Created":"2017-10-06T17:19:34.3995426Z",
"Key":"ValidationResponse",
"Persistent":true,
"Value":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'.\\r\\nTrace ID: 55555555-cccc-cccc-cccc-555555555555\\r\\nCorrelation ID: 77777777-7777-7777-7777-777777777777\\r\\nTimestamp: 2017-10-06 17:19:33Z\",\"error_codes\":[70002],\"timestamp\":\"2017-10-06 17:19:33Z\",\"trace_id\":\"55555555-cccc-cccc-cccc-555555555555\",\"correlation_id\":\"77777777-7777-7777-7777-777777777777\"};1;login-NonInteractive;False"
},
Run Code Online (Sandbox Code Playgroud)
重要的一点似乎是:
"AADSTS70002:请求正文必须包含以下参数:'client_secret或client_assertion"
后来它说:
"抛出了类型'Web.TPEngine.Providers.BadArgumentRetryNeededException'的异常."
我仔细检查了一些事情:
任何帮助深表感谢.谢谢.
是否可以在 Slack 应用程序开发的重定向 URL 中使用通配符?
我正在尝试输入一个类似于以下内容的重定向网址:https://*.SaasApp.com
Slack 似乎不允许使用“*”。有没有办法让 Slack 的 OAuth 实现允许回复本例中“SaasApp.com”的所有子域?
我正在寻找一个 Graph API 调用,它可以将 Sharepoint Online 中的所有站点返回给我。
查看枚举站点:https : //docs.microsoft.com/en-us/graph/api/site-list? view = graph-rest-beta & tabs =http
GET https://graph.microsoft.com/beta/sites?filter=siteCollection/root ne null
Run Code Online (Sandbox Code Playgroud)
它似乎没有返回基于组的站点或子站点。
查看站点搜索:https : //docs.microsoft.com/en-us/graph/api/site-search?view=graph-rest-beta&tabs=http
GET https://graph.microsoft.com/beta/sites?search={query}
Run Code Online (Sandbox Code Playgroud)
这可能更有希望,但没有解释“查询”应该如何构建或搜索什么。
我的想法是,由于所有站点 ID 都以租户域开头,因此我可以搜索该域,然后检索租户的每个站点和子站点。但我不确定如何执行该查询。
理想情况下是这样的:
GET https://graph.microsoft.com/beta/sites?search=id like contoso.microsoft.com
Run Code Online (Sandbox Code Playgroud) 问题
我在 Kong 错误日志中收到一条错误消息,报告上游服务器已超时。但我知道上游进程只花了一分钟,当它完成时(在 Kong 记录了错误之后)它会记录一个 java 错误“Broken Pipe”,这意味着 Kong 不再监听响应。
这是上游进程花费的时间超过 60 秒时的行为。在某些情况下,只需不到 60 秒,一切正常。
如何延长 Kong 的超时时间?
细节
金刚版
1.1.2
Run Code Online (Sandbox Code Playgroud)
Kong的错误信息(略有编辑):
2019/12/06 09:57:10 [error] 1421#0: *1377 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xyz.xyz.xyz.xyz, server: kong, request: "POST /api/...... HTTP/1.1", upstream: "http://127.0.0.1:8010/api/.....", host: "xyz.xyz.com"
Run Code Online (Sandbox Code Playgroud)
这是上游服务器日志中的错误(Java / Tomcat via SpringBoot)
Dec 06 09:57:23 gateway-gw001-99 java[319]: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
Dec 06 09:57:23 gateway-gw001-99 java[319]: at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:364) ~[tomcat-embed-core-8.5.42.jar!/
Dec 06 09:57:23 gateway-gw001-99 java[319]: …
Run Code Online (Sandbox Code Playgroud) azure-ad-b2c ×3
azure ×2
jax-rs ×1
jersey ×1
jersey-2.0 ×1
kong ×1
nginx ×1
sharepoint ×1
slack-api ×1
spring-boot ×1
timeout ×1