Comments (5)
@andreasgerner can you share your project or a reproducer? What you are doing seems pretty close to what is done at several places in this repo (and others that I author), so it should work (this can be due to your security config or whatever)...
from spring-addons.
I setup a sample containing everything that should be needed to reproduce.
from spring-addons.
@andreasgerner I found a few things to fix in your reproducer:
- the values in your
src/main/resources/application.yaml
should be resolved (use environment variables to override this values when you start the program, not inside the yaml)
oidc:
issuer-url: https://some-issuer.com/auth/realms/master
client-id: client-id
- the test resources override main application.properties and the
com.c4-soft.*
are lost => renamesrc/test/resources/application.yaml
tosrc/test/resources/application-test.yaml
- the test itself is not a Spring test (you probably want to run a
@WithMckMvc
or@SpringBootTest
, so decorate the test with what is relevant)
from spring-addons.
Migrating from pure unit tests to @SpringBootTest
integration tests resolved my issue, thank you!
from spring-addons.
@andreasgerner you're welcome. thank you for taking time to provide with reproducer. Please note that @SpringBootTest
should be used with care as it can slow down tests execution by loading more of the application context than what is actually needed. Use @WebMvcTest
when testing a controller and specify the minimum configuration classes to load when using @SpringBootTest
.
from spring-addons.
Related Issues (20)
- Resource server token introspection - ClassCastException HOT 3
- Configurable HTTP status for responses to authorization_code flow initiation, authorization-code callback and logout HOT 1
- Sample Flutter-Android application with BFF pattern
- Missing default authentication converter when using `@WithJwt` HOT 1
- Spring Boot [3.2.0] is not compatible with this Spring Cloud release train HOT 3
- (Not a bug, jus a question) How do I add a filter ? HOT 2
- Deprecated WithMockJwtAuth Annotation Concern HOT 12
- Per request post-login and post-logout URIs HOT 1
- NPE when trying to protect client HOT 2
- After 7.3.0 authentication for web mvc client against keycloak ends in endless redirect HOT 8
- Exception thrown when `post-logout-redirect-path` configuration property is null HOT 1
- Post-login success & failure URI params and headers on authentication request are ignored in reactive applications HOT 1
- `authorization-request-params` ignored HOT 1
- POST /logout response Forbidden 403 HOT 9
- Support several JWT authentication converters (or converters with a `@Qualifier` which is not `jwtAuthenticationConverter`)
- Doubled path-prefix by `SpringAddonsServerOAuth2AuthorizationRequestResolver` HOT 1
- Allow anonymous CORS preflight requests (`OPTIONS` requests to a path configured with CORS) HOT 1
- Configuration properties to add parameters to token requests HOT 1
- Spring Starter OICD, Resource Server: Option to disable the default behavior for authorized/protected routes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-addons.