Comments (5)
@puneetbabbar26 This is most likely due to conflicting dependency versions. Can you post your pom.xml or create a sample project with the same dependencies and post the link here?
from mock-oauth2-server.
Hey @tommytroen
I tried a Java command line with the entire classpath as well (as derived from pom) to replicate the issue.
here it is
java -classpath ~/.m2/repository/net/minidev/json-smart/2.3/json-smart-2.3.jar:~.m2/repository/com/nimbusds/nimbus-jose-jwt/8.20.2/nimbus-jose-jwt-8.20.2.jar:~.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.4/jackson-core-2.11.4.jar:~.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar:~.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.4/jackson-annotations-2.11.4.jar:~.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:~.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.jar:~.m2/repository/no/nav/security/mock-oauth2-server/0.3.3/mock-oauth2-server-0.3.3.jar:~.m2/repository/com/squareup/okhttp3/mockwebserver/3.14.9/mockwebserver-3.14.9.jar:~.m2/repository/com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9.jar:~.m2/repository/com/nimbusds/oauth2-oidc-sdk/8.36.1/oauth2-oidc-sdk-8.36.1.jar:~.m2/repository/com/nimbusds/lang-tag/1.4.4/lang-tag-1.4.4.jar:~.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.4.32/kotlin-stdlib-1.4.32.jar:~.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:~.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:~.m2/repository/io/netty/netty-all/4.1.63.Final/netty-all-4.1.63.Final.jar:~.m2/repository/io/github/microutils/kotlin-logging-jvm/2.0.6/kotlin-logging-jvm-2.0.6.jar:~.m2/repository/com/fasterxml/jackson/module/jackson-module-kotlin/2.11.4/jackson-module-kotlin-2.11.4.jar:~.m2/repository/org/freemarker/freemarker/2.3.31/freemarker-2.3.31.jar no.nav.security.mock.oauth2.StandaloneMockOAuth2ServerKt
Here's the list of dependencies for easy reading
net/minidev/json-smart/2.3/json-smart-2.3.jar
com/nimbusds/nimbus-jose-jwt/8.20.2/nimbus-jose-jwt-8.20.2.jar
com/fasterxml/jackson/core/jackson-core/2.11.4/jackson-core-2.11.4.jar
com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar
com/fasterxml/jackson/core/jackson-annotations/2.11.4/jackson-annotations-2.11.4.jar
org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar
org/jetbrains/kotlin/kotlin-reflect/1.4.32/kotlin-reflect-1.4.32.jar
no/nav/security/mock-oauth2-server/0.3.3/mock-oauth2-server-0.3.3.jar
com/squareup/okhttp3/mockwebserver/3.14.9/mockwebserver-3.14.9.jar
com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9.jar
com/nimbusds/oauth2-oidc-sdk/8.36.1/oauth2-oidc-sdk-8.36.1.jar
com/nimbusds/lang-tag/1.4.4/lang-tag-1.4.4.jar
org/jetbrains/kotlin/kotlin-stdlib/1.4.32/kotlin-stdlib-1.4.32.jar
ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar
io/netty/netty-all/4.1.63.Final/netty-all-4.1.63.Final.jar
io/github/microutils/kotlin-logging-jvm/2.0.6/kotlin-logging-jvm-2.0.6.jar
com/fasterxml/jackson/module/jackson-module-kotlin/2.11.4/jackson-module-kotlin-2.11.4.jar
from mock-oauth2-server.
@puneetbabbar26 it looks like you have got the wrong versions of the okhttp3
libs - they should be on at least 4.9.1
, but in your output they are on 3.14.9
:
com/squareup/okhttp3/mockwebserver/3.14.9/mockwebserver-3.14.9.jar
com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9.jar
Are you using Spring Boot in your app? I know some users have had some issues with Spring managed versions on okhttp3
. If you are using Spring you can try to set the property okhttp3.version
to 4.9.1
in your pom.xml.
from mock-oauth2-server.
Thanks @tommytroen I was able to get it to run after spending a lot of time trying to fix the dependencies.
Suggestion - For standalone can you provide a FAT JAR that has all the dependencies that are needed to run the mock-oauth2-server with ease?
Also, I have struggled badly to get the mock server to behave correctly with the expectations and correct tokens. I have used the following file to add 5 different users.
{
"interactiveLogin": false,
"httpServer": "NettyWrapper",
"tokenCallbacks": [
{
"issuerId": "default",
"tokenExpiry": 3600,
"requestMappings": [
{
"requestParam": "testparam1",
"match": "testuser1",
"claims": {
"userid": "testuser1"
}
}
]
},
{
"issuerId": "default",
"tokenExpiry": 3600,
"requestMappings": [
{
"requestParam": "testparam2",
"match": "testuser2",
"claims": {
"userid": "testuser2"
}
}
]
},
{
"issuerId": "default",
"tokenExpiry": 3600,
"requestMappings": [
{
"requestParam": "posuser1",
"match": "posuser1",
"claims": {
"userid": "posuser1"
}
}
]
},
{
"issuerId": "default",
"tokenExpiry": 3600,
"requestMappings": [
{
"requestParam": "posmanager1",
"match": "posmanager1",
"claims": {
"userid": "posmanager1"
}
}
]
},
{
"issuerId": "default",
"tokenExpiry": 3600,
"requestMappings": [
{
"requestParam": "testparam3",
"match": "testuser3",
"claims": {
"userid": "testuser3"
}
}
]
}
]
}
The server would only retain 1 match (randomly) and send the custom claim in token and would not send the custom claim in the token for others.
This is very frustrating to use, you should spruce up the documentation.
I am giving up now, will see in the next few months if the developer experience has improved
from mock-oauth2-server.
Sorry to hear that you feel its frustrating to use, it can be hard to predict use-cases and how the server is used by different users. We will have a look at the documentation. If you have any specific issues please feel free to open separate issues with details for this. In regards to the FAT jar use case we feel this is covered by the docker version. Closing this issue now.
from mock-oauth2-server.
Related Issues (20)
- Possibility to revoke token HOT 6
- HTTP 405 Method Not Allowed for custom CSS and JavaScript files. HOT 3
- End session endpoint ignores state parameter.
- interactiveLogin and hint from tokenCallbacks/requestMappings HOT 3
- Reject authorization code HOT 4
- No container image for 2.0.0 HOT 11
- Support for kotlin 1.6.x HOT 17
- Cannot exclude JUnit 4 dependency HOT 13
- Basic Client Authentication not supported for the Token Exchange Grant HOT 2
- Dependabot automerge HOT 2
- [Help wanted] Spring Boot - TestContainers - Simple BearerToken? HOT 5
- Publish fat jar to https://repo1.maven.org/maven2/no/nav/security/mock-oauth2-server/ HOT 4
- Support changing Clock to control time in testing with embedded server HOT 7
- Inconsistent URL host names due to platform specific DNS resolution
- Request mapping order HOT 1
- dynamic clientid for other value than sub HOT 6
- New release HOT 1
- Unique new refresh token on refresh HOT 1
- Out of data README HOT 2
- Logback.xml overwrites own logback config 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 mock-oauth2-server.