|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2019 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -49,11 +49,12 @@ private ReactiveJwtDecoders() {
|
49 | 49 | * @return a {@link ReactiveJwtDecoder} that was initialized by the OpenID Provider
|
50 | 50 | * Configuration.
|
51 | 51 | */
|
52 |
| - public static ReactiveJwtDecoder fromOidcIssuerLocation(String oidcIssuerLocation) { |
| 52 | + @SuppressWarnings("unchecked") |
| 53 | + public static <T extends ReactiveJwtDecoder> T fromOidcIssuerLocation(String oidcIssuerLocation) { |
53 | 54 | Assert.hasText(oidcIssuerLocation, "oidcIssuerLocation cannot be empty");
|
54 | 55 | Map<String, Object> configuration = JwtDecoderProviderConfigurationUtils
|
55 | 56 | .getConfigurationForOidcIssuerLocation(oidcIssuerLocation);
|
56 |
| - return withProviderConfiguration(configuration, oidcIssuerLocation); |
| 57 | + return (T) withProviderConfiguration(configuration, oidcIssuerLocation); |
57 | 58 | }
|
58 | 59 |
|
59 | 60 | /**
|
@@ -85,11 +86,12 @@ public static ReactiveJwtDecoder fromOidcIssuerLocation(String oidcIssuerLocatio
|
85 | 86 | * @return a {@link ReactiveJwtDecoder} that was initialized by one of the described
|
86 | 87 | * endpoints
|
87 | 88 | */
|
88 |
| - public static ReactiveJwtDecoder fromIssuerLocation(String issuer) { |
| 89 | + @SuppressWarnings("unchecked") |
| 90 | + public static <T extends ReactiveJwtDecoder> T fromIssuerLocation(String issuer) { |
89 | 91 | Assert.hasText(issuer, "issuer cannot be empty");
|
90 | 92 | Map<String, Object> configuration = JwtDecoderProviderConfigurationUtils
|
91 | 93 | .getConfigurationForIssuerLocation(issuer);
|
92 |
| - return withProviderConfiguration(configuration, issuer); |
| 94 | + return (T) withProviderConfiguration(configuration, issuer); |
93 | 95 | }
|
94 | 96 |
|
95 | 97 | /**
|
|
0 commit comments