1
0
mirror of synced 2026-08-04 01:07:02 +00:00

Polish gh-4557

This commit is contained in:
Joe Grandja
2020-02-11 04:20:59 -05:00
parent 71a5c9521c
commit ff8002eb2e
27 changed files with 618 additions and 932 deletions
@@ -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);
}
}
@@ -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");
}
}