Polish gh-4557
This commit is contained in:
+12
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,6 +17,10 @@
|
||||
package org.springframework.security.oauth2.core.endpoint;
|
||||
|
||||
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.core.oidc.endpoint.OidcParameterNames;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Rob Winch
|
||||
@@ -27,4 +31,11 @@ public class TestOAuth2AccessTokenResponses {
|
||||
return OAuth2AccessTokenResponse.withToken("token")
|
||||
.tokenType(OAuth2AccessToken.TokenType.BEARER);
|
||||
}
|
||||
|
||||
public static OAuth2AccessTokenResponse.Builder oidcAccessTokenResponse() {
|
||||
Map<String, Object> additionalParameters = new HashMap<>();
|
||||
additionalParameters.put(OidcParameterNames.ID_TOKEN, "id-token");
|
||||
return accessTokenResponse()
|
||||
.additionalParameters(additionalParameters);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,4 +36,8 @@ public class TestOAuth2AuthorizationRequests {
|
||||
.state("state")
|
||||
.attributes(attributes);
|
||||
}
|
||||
|
||||
public static OAuth2AuthorizationRequest.Builder oidcRequest() {
|
||||
return request().scope("openid");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user