⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.jsp

📁 开源的OpenId的一个java实现
💻 JSP
字号:
<%@page import="org.wso2.solutions.identity.relyingparty.TokenVerifierConstants"%><%@page import="org.wso2.solutions.identity.relyingparty.HTMLEncoder"%><%@page import="org.wso2.solutions.identity.IdentityConstants"%><html><head><title>Hello, World</title></head><body><img src="images/logo.gif" /><% String auth = (String)request.getAttribute(TokenVerifierConstants.SERVLET_ATTR_STATE);if(auth != null && TokenVerifierConstants.STATE_SUCCESS.equals(auth)) {String givenName = (String)request.getAttribute(IdentityConstants.CLAIM_GIVEN_NAME);String roles = (String)request.getAttribute("http://identity.wso2.org/claims/roles");if(givenName == null) {%><h2>Error! Given name is null</h2><%            } else if(roles == null) {%><h2>Error! roles value is null</h2><%            } else {%><h2>Welcome <%= HTMLEncoder.encode(givenName) %> !!!</h2><p>Roles you have : </p> <%= HTMLEncoder.encode(roles) %>	<%	if(roles.indexOf("admin") >= 0) {	%>	   <h3>You are an admin user</h3>	<%	} else {	%>	   <h3>You don't have admin rights.</h3> 	<%	}	%><p></p><p>You are logged into the WSO2 Identity Solution access control sample :-)</p><p>If you are not an "admin" user you can assign the "admin" role using <a href="../wsas/">wsas</a> management console and then try logging in again.</p><%}} else {%><h2>Login failure !!!</h2> <h3><%=(String)request.getAttribute(TokenVerifierConstants.FAILURE_REASON) %></h3><%}%><p><a href="index.html">Back</a></p><hr/><a href="http://www.wso2.org/projects/solutions/identity">WSO2 Identity Solution</a></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -