Add mapping for DPoP in DefaultMapOAuth2AccessTokenResponseConverter
	
		
			
	
		
	
	
		
			
				
	
				CI / Build (17, ubuntu-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Build (17, windows-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (17, 17) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (21-ea, 21) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Check Samples (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Deploy Artifacts (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Docs (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Schema (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Perform Release (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Send Notification (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				Deploy Docs / build (push) Waiting to run
				
					Details
				
			
		
	
				
					
				
			
				
	
				CI / Build (17, ubuntu-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Build (17, windows-latest) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (17, 17) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Test Against Snapshots (21-ea, 21) (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Check Samples (push) Waiting to run
				
					Details
				
			
		
			
				
	
				CI / Deploy Artifacts (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Docs (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Deploy Schema (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Perform Release (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				CI / Send Notification (push) Blocked by required conditions
				
					Details
				
			
		
			
				
	
				Deploy Docs / build (push) Waiting to run
				
					Details
				
			
		
	Closes gh-16806 Signed-off-by: muha <muha@kreftregisteret.no>
This commit is contained in:
		
							parent
							
								
									126cb71856
								
							
						
					
					
						commit
						1a4602c8c3
					
				|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2021 the original author or authors. |  * Copyright 2002-2025 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -70,6 +70,10 @@ public final class DefaultMapOAuth2AccessTokenResponseConverter | ||||||
| 			.equalsIgnoreCase(getParameterValue(tokenResponseParameters, OAuth2ParameterNames.TOKEN_TYPE))) { | 			.equalsIgnoreCase(getParameterValue(tokenResponseParameters, OAuth2ParameterNames.TOKEN_TYPE))) { | ||||||
| 			return OAuth2AccessToken.TokenType.BEARER; | 			return OAuth2AccessToken.TokenType.BEARER; | ||||||
| 		} | 		} | ||||||
|  | 		else if (OAuth2AccessToken.TokenType.DPOP.getValue() | ||||||
|  | 			.equalsIgnoreCase(getParameterValue(tokenResponseParameters, OAuth2ParameterNames.TOKEN_TYPE))) { | ||||||
|  | 			return OAuth2AccessToken.TokenType.DPOP; | ||||||
|  | 		} | ||||||
| 		return null; | 		return null; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| /* | /* | ||||||
|  * Copyright 2002-2021 the original author or authors. |  * Copyright 2002-2025 the original author or authors. | ||||||
|  * |  * | ||||||
|  * Licensed under the Apache License, Version 2.0 (the "License"); |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  * you may not use this file except in compliance with the License. |  * you may not use this file except in compliance with the License. | ||||||
|  | @ -98,6 +98,18 @@ public class DefaultMapOAuth2AccessTokenResponseConverterTests { | ||||||
| 		assertThat(additionalParameters).isEmpty(); | 		assertThat(additionalParameters).isEmpty(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	@Test | ||||||
|  | 	public void shouldConvertDPoPToken() { | ||||||
|  | 		Map<String, Object> map = new HashMap<>(); | ||||||
|  | 		map.put("access_token", "access-token-1234"); | ||||||
|  | 		map.put("token_type", "dpop"); | ||||||
|  | 		OAuth2AccessTokenResponse converted = this.messageConverter.convert(map); | ||||||
|  | 		OAuth2AccessToken accessToken = converted.getAccessToken(); | ||||||
|  | 		assertThat(accessToken).isNotNull(); | ||||||
|  | 		assertThat(accessToken.getTokenValue()).isEqualTo("access-token-1234"); | ||||||
|  | 		assertThat(accessToken.getTokenType()).isEqualTo(OAuth2AccessToken.TokenType.DPOP); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	@Test | 	@Test | ||||||
| 	public void shouldConvertWithUnsupportedExpiresIn() { | 	public void shouldConvertWithUnsupportedExpiresIn() { | ||||||
| 		Map<String, Object> map = new HashMap<>(); | 		Map<String, Object> map = new HashMap<>(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue