Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 5464922

Browse files
eleftheriassdeleuze
authored andcommitted
Fix Security OAuth2 Client OIDC
Closes gh-1377
1 parent 670aa26 commit 5464922

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
/*
3+
* Copyright 2019-2021 the original author or authors.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.springframework.security.oauth2.jwt;
19+
20+
import org.springframework.nativex.AotOptions;
21+
import org.springframework.nativex.hint.NativeHint;
22+
import org.springframework.nativex.hint.TypeHint;
23+
import org.springframework.nativex.type.NativeConfiguration;
24+
import org.springframework.security.oauth2.client.authentication.OAuth2LoginAuthenticationToken;
25+
import org.springframework.util.ClassUtils;
26+
27+
@NativeHint(trigger = OAuth2LoginAuthenticationToken.class,
28+
types = @TypeHint(typeNames = "org.springframework.security.oauth2.jwt.JwtDecoder")
29+
)
30+
public class JwtHints implements NativeConfiguration {
31+
@Override
32+
public boolean isValid(AotOptions aotOptions) {
33+
return ClassUtils.isPresent("org.springframework.security.oauth2.jwt.JwtDecoder", null);
34+
}
35+
}

spring-native-configuration/src/main/resources/META-INF/spring.factories

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ org.springframework.security.config.annotation.method.configuration.GlobalMethod
114114
org.springframework.security.config.annotation.web.configuration.WebMvcSecurityHints,\
115115
org.springframework.security.config.annotation.web.reactive.WebFluxSecurityHints,\
116116
org.springframework.security.ldap.LdapSecurityHints,\
117+
org.springframework.security.oauth2.jwt.JwtHints,\
117118
org.springframework.security.thymeleaf.ThymeleafSpringSecurity5Hints,\
118119
org.springframework.security.test.SpringSecurityTestHints,\
119120
org.springframework.session.servlet.HttpSessionHints,\

0 commit comments

Comments
 (0)