本文整理汇总了Java中com.nimbusds.openid.connect.sdk.Display类的典型用法代码示例。如果您正苦于以下问题:Java Display类的具体用法?Java Display怎么用?Java Display使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Display类属于com.nimbusds.openid.connect.sdk包,在下文中一共展示了Display类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultOPMetadata
import com.nimbusds.openid.connect.sdk.Display; //导入依赖的package包/类
protected OIDCProviderMetadata getDefaultOPMetadata() throws ParseException {
Issuer issuer = getMetadataIssuer();
List<SubjectType> subjectTypes = Arrays.asList(SubjectType.PUBLIC);
URI jwksUri = UriBuilder.fromUri(baseUri).path(JWKS_PATH).build();
OIDCProviderMetadata md = new OIDCProviderMetadata(issuer, subjectTypes, jwksUri);
md.applyDefaults();
// endpoints
URI authzEndpt = getMetadataAuthorizationEndpoint();
URI tokenEndpt = getMetadataTokenEndpoint();
URI userInfoEndpt = getMetadataUserinfoEndpoint();
URI registrationEndpt = getMetadataRegistrationEndpoint();
md.setAuthorizationEndpointURI(authzEndpt);
md.setTokenEndpointURI(tokenEndpt);
md.setUserInfoEndpointURI(userInfoEndpt);
md.setRegistrationEndpointURI(registrationEndpt);
// , ResponseType.parse("id_token"), ResponseType.parse("token id_token"));
Scope scopes = new Scope("openid");
List<ResponseType> responseTypes = Arrays.asList(ResponseType.parse("code"), ResponseType.parse("id_token"),
ResponseType.parse("token id_token"));
List<ResponseMode> responseModes = Arrays.asList(ResponseMode.QUERY, ResponseMode.FRAGMENT, ResponseMode.FORM_POST);
List<GrantType> grantTypes = Arrays.asList(GrantType.AUTHORIZATION_CODE, GrantType.IMPLICIT);
md.setScopes(scopes);
md.setResponseTypes(responseTypes);
md.setResponseModes(responseModes);
md.setGrantTypes(grantTypes);
// algorithms
List<JWSAlgorithm> jwsAlgs = Arrays.asList(JWSAlgorithm.RS256, JWSAlgorithm.parse("none"));
md.setIDTokenJWSAlgs(jwsAlgs);
List<ClientAuthenticationMethod> authMethods = Arrays.asList(ClientAuthenticationMethod.CLIENT_SECRET_BASIC);
md.setTokenEndpointAuthMethods(authMethods);
List<Display> displays = Arrays.asList(Display.PAGE);
md.setDisplays(displays);
return md;
}
示例2: buildAuthorizationURL
import com.nimbusds.openid.connect.sdk.Display; //导入依赖的package包/类
private String buildAuthorizationURL(HttpServerExchange exchange) {
try {
ClientID clientId = new ClientID(oidcProvider.getClientId());
ResponseType responseType = new ResponseType(oidcProvider.getResponseType());
ResponseMode responseMode = ResponseMode.FORM_POST;
Prompt prompt = new Prompt(Prompt.Type.LOGIN);
Display display = Display.PAGE;
Scope scope = Scope.parse(oidcProvider.getScope());
String redirectURL = RedirectBuilder.redirect(exchange, redirectPath, false);
URI redirectURI = new URI(redirectURL);
String returnURL = null;
if (!exchange.getRequestPath().equals(redirectPath)) {
returnURL = RedirectBuilder.redirect(exchange, exchange.getRelativePath());
} else {
returnURL = RedirectBuilder.redirect(exchange, "/", false);
}
String stateValue = persistState(returnURL, exchange);
State state = stateValue != null ? new State(stateValue) : null;
Nonce nonce = new Nonce();
if (oidcProvider.isCheckNonce()) {
getSession(exchange).setAttribute(NONCE_KEY, nonce.getValue());
}
AuthenticationRequest authRequest = new AuthenticationRequest(oidcProvider.getAuthURI(), responseType, responseMode, scope, clientId, redirectURI, state, nonce, display, prompt, -1, null, null, null, null, null, oidcProvider.getClaims(), null, null, null, null);
return authRequest.toURI().toString();
} catch (Exception e) {
LOG.log(Level.SEVERE, "", e);
return null;
}
}
示例3: displays
import com.nimbusds.openid.connect.sdk.Display; //导入依赖的package包/类
private List<Display> displays() {
return Arrays.asList(Display.PAGE, Display.POPUP, Display.TOUCH);
}