?? openidaxsubmit.jsp
字號(hào):
<%@page import="org.wso2.solutions.identity.relyingparty.TokenVerifierConstants"%>
<%@page import="org.wso2.solutions.identity.relyingparty.HTMLEncoder"%>
<%@page import="org.wso2.solutions.identity.IdentityConstants"%>
<%@page import="org.wso2.solutions.identity.relyingparty.openid.OpenIDAuthenticationRequest"%>
<%@page import="org.wso2.solutions.identity.relyingparty.openid.OpenIDConsumer"%>
<%@page import="org.wso2.solutions.identity.relyingparty.openid.OpenIDRequestType"%>
<%@page import="org.wso2.solutions.identity.relyingparty.RelyingPartyException"%>
<%@page import="org.wso2.utils.ServerConfiguration"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<%
try
{
OpenIDAuthenticationRequest openIDAuthRequest = null;
openIDAuthRequest = new OpenIDAuthenticationRequest(request,response);
openIDAuthRequest.setOpenIDUrl((String)request.getParameter("openIdUrl"));
ServerConfiguration serverConfig = null;
String host = null;
String httpsPort = null;
String useOpenIDSchema = null;
serverConfig = ServerConfiguration.getInstance();
host = serverConfig.getFirstProperty("HostName");
httpsPort = serverConfig.getFirstProperty("Ports.HTTPS");
useOpenIDSchema = (String)request.getParameter("useSchema");
openIDAuthRequest
.addRequestType(OpenIDRequestType.ATTRIBUTE_EXCHANGE);
if (useOpenIDSchema != null && useOpenIDSchema .equalsIgnoreCase("true"))
{
// Set the required claims - I need these claims from the OpenID
// Provider.
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME,
"http://schema.openid.net/namePerson/friendly");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME,
"http://schema.openid.net/namePerson");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.EMAIL,
"http://schema.openid.net/contact/email");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.DOB,
"http://schema.openid.net/birthDate");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.GENDER,
"http://schema.openid.net/person/gender");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.POSTAL_CODE,
"http://schema.openid.net/contact/postalCode/home");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.COUNTRY,
"http://schema.openid.net/contact/country/home");
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.LANGUAGE,
"http://schema.openid.net/pref/language");
}
else
{
// Set the required claims - I need these claims from the OpenID
// Provider.
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME,
IdentityConstants.OpenId.ExchangeAttributes.NICK_NAME_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME,
IdentityConstants.OpenId.ExchangeAttributes.FULL_NAME_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.EMAIL,
IdentityConstants.OpenId.ExchangeAttributes.EMAIL_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.DOB,
IdentityConstants.OpenId.ExchangeAttributes.DOB_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.GENDER,
IdentityConstants.OpenId.ExchangeAttributes.GENDER_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.POSTAL_CODE,
IdentityConstants.OpenId.ExchangeAttributes.POSTAL_CODE_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.COUNTRY,
IdentityConstants.OpenId.ExchangeAttributes.COUNTRY_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.LANGUAGE,
IdentityConstants.OpenId.ExchangeAttributes.LANGUAGE_NS);
openIDAuthRequest.addRequiredClaims(
IdentityConstants.OpenId.ExchangeAttributes.TIMEZONE,
IdentityConstants.OpenId.ExchangeAttributes.TIMEZONE_NS);
}
openIDAuthRequest.setReturnUrl("https://" + host + ":" + httpsPort + "/" + "javarp/openidloggedin.jsp");
OpenIDConsumer.getInstance().doOpenIDAuthentication(openIDAuthRequest);
}
catch(RelyingPartyException e)
{
out.println(e.getMessage());
}
%>
<br/><br/>
<a href="index.html">Back</a>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -