我已经实现了一个 SAML 服务提供程序来支持 ASP.Net Web 门户的单点登录,该门户是在客户端站点上配置的收缩包装软件,并且必须能够与任何符合 SAML 的身份提供程序进行交互。
我的断言消费者服务 (ACS) 页面将通过 GET 和 POST 方法接受 SAML 响应。
据我了解 SAML 协议,SAML Request ProtocolBinding属性指定响应支持哪些协议。目前,我的请求指定了 HTTP 重定向绑定。但是,我想声明我支持HTTP-Redirect (GET) 和HTTP-POST (POST)。在搜索了比我想重申的更多的 SAML 文档后,我无法找到用于声明多个受支持的协议绑定的语法(或者它是否有效)。
虽然我可以使此声明可配置,但我的偏好是声明这两个绑定,以便身份提供程序无需额外配置我的门户即可工作。
以下是我的身份验证请求的示例。请,如果有人知道为 ProtocolBinding 声明 HTTP-Redirect 和 HTTP-POST 的方法,我将非常感谢您的输入!
<?xml version="1.0" encoding="utf-8"?>
<samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="[AUTHN_ID]"
Version="2.0"
IssueInstant="[ISSUE_INSTANT]"
ProtocolBinding="urn:oasis:names.tc:SAML:2.0:bindings:HTTP-Redirect"
ProviderName="[PROVIDER_NAME]"
AssertionConsumerServiceURL="[ACS_URL]">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
PortalEntityID
</saml:Issuer>
<samlp:NameIDPolicy
AllowCreate="true"
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" />
</samlp:AuthnRequest>
Run Code Online (Sandbox Code Playgroud)
预先感谢任何可以提供帮助的人!
所有,
为什么建议将StringBuffer/ StringBuilderobject的大小初始化为2 ^ {1 ... n}的大小(尽管通常它将> 64).这样做会有什么优势/优化?
我是新手使用库,但我需要能够向忘记密码的用户发送电子邮件.我正在尝试使用JavaMail和Apache Commons Email来实现这一点.但是,我认为我必须错误地导入库.
当我尝试发送电子邮件时,收到以下消息:
Apr 17, 2011 11:54:33 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 60 in the jsp file: /sendpw.jsp
The type javax.mail.Authenticator cannot be resolved. It is indirectly referenced from required .class files
Run Code Online (Sandbox Code Playgroud)
代码:
57: EmailAuthentication ea = new EmailAuthentication();
58: String authUser = ea.getUser();
59: String authPw = ea.getPw();
60: email.setAuthenticator(new DefaultAuthenticator(authUser, authPw));
61: email.setTLS(true);
62: email.setFrom(authUser+"@gmail.com");
63: email.setSubject("Your Last Love Password"); …Run Code Online (Sandbox Code Playgroud) 我创建了一个这样的Student类:
public class Student implements Comparable<Student> {
private String firstName;
private String lastName;
public Student(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
// Getters & Setters follow here...
@Override
public int compareTo(Student student) {
int hash = this.firstName.compareTo(student.firstName);
return hash;
}
@Override
public String toString() {
return "Student [firstName=" + firstName + ", lastName=" + lastName
+ "]";
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的测试类,我只是在我的TreeSet中添加元素:
public class SortedSetExample1 {
public static void main(String[] args) {
SortedSet<Student> set = new TreeSet<Student>(); …Run Code Online (Sandbox Code Playgroud) 我希望这是一个可以接受的问题.我理解递归的思维模式,我想要考虑基本情况然后是递归情况,但是考虑到一些比较困难的BST问题,我只是画空白而感觉就像我迷失了,没有一个好的方向.
以链接列表为例,似乎有一种模式可以解决问题,但BT似乎要么你知道也要不知道.任何提示/指针?我似乎已经解决的唯一概念是,如果我正在处理空节点并且我想对它们或它们做一些事情,我将把它作为一个案例
if(root == null)
//do something
Run Code Online (Sandbox Code Playgroud)
或者如果我没有与null节点有任何关系,那么我使用倒置的基本情况
if(root != null)
//do stuff
else
//do nothing for null case
Run Code Online (Sandbox Code Playgroud)
但即便如此,我还是会对下一步感到茫然.我想这是一个我遇到的问题的例子,不知道如何接近.我不一定在寻找答案,只是处理这类问题的潜在策略(以及常规的二叉树问题).
编写一个方法numberNodes来更改存储在二叉树中的数据,为每个节点分配以1开头的顺序整数,以便预先遍序遍历将按顺序生成数字(1,2,3等).例如,给定左下方树引用的树,调用tree.numberNodes();将覆盖现有数据,将节点值从1分配给6,以便生成树的预先遍历1, 2, 3, 4, 5, 6.
你不要改变树的结构.您只是更改存储在数据字段中的值.您的方法应返回树中有多少节点的计数.
假设您要将此方法添加到IntTree类中,如下所示:
public class IntTree {
private IntTreeNode overallRoot;
...
}
Run Code Online (Sandbox Code Playgroud)
在盯着代码之后,我想我应该用我int count的方法来确定我是否前往左根或右根,因为它是一个二叉搜索树但是我仍然无法实现这个功能......啊编码块!
我想使用Tomcat Web服务器从我的PC上发布我的JSP项目.我怎样才能做到这一点?
好的,这是基本的,但似乎正常的方法对我不起作用。
我正在尝试导入 jSSC 库,用于与串行端口等通信。最新的库是 jSSC-0.9.0-Release
所以,我尝试了以下方法:
然后我尝试包含库中的内容:
import jssc.SerialPortList;
Run Code Online (Sandbox Code Playgroud)
错误:无法解析导入jssc
结果:同样的错误。
对于导入库的简单操作,我在这里缺少什么基本信息/操作?