mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 02:49:11 +00:00
Provide Casting for ReactiveJwtDecoder
Closes gh-15773
This commit is contained in:
parent
a88a7744ed
commit
2c9c309d7f
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@ -49,11 +49,12 @@ public final class ReactiveJwtDecoders {
|
||||
* @return a {@link ReactiveJwtDecoder} that was initialized by the OpenID Provider
|
||||
* Configuration.
|
||||
*/
|
||||
public static ReactiveJwtDecoder fromOidcIssuerLocation(String oidcIssuerLocation) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends ReactiveJwtDecoder> T fromOidcIssuerLocation(String oidcIssuerLocation) {
|
||||
Assert.hasText(oidcIssuerLocation, "oidcIssuerLocation cannot be empty");
|
||||
Map<String, Object> configuration = JwtDecoderProviderConfigurationUtils
|
||||
.getConfigurationForOidcIssuerLocation(oidcIssuerLocation);
|
||||
return withProviderConfiguration(configuration, oidcIssuerLocation);
|
||||
return (T) withProviderConfiguration(configuration, oidcIssuerLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,11 +86,12 @@ public final class ReactiveJwtDecoders {
|
||||
* @return a {@link ReactiveJwtDecoder} that was initialized by one of the described
|
||||
* endpoints
|
||||
*/
|
||||
public static ReactiveJwtDecoder fromIssuerLocation(String issuer) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends ReactiveJwtDecoder> T fromIssuerLocation(String issuer) {
|
||||
Assert.hasText(issuer, "issuer cannot be empty");
|
||||
Map<String, Object> configuration = JwtDecoderProviderConfigurationUtils
|
||||
.getConfigurationForIssuerLocation(issuer);
|
||||
return withProviderConfiguration(configuration, issuer);
|
||||
return (T) withProviderConfiguration(configuration, issuer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user