marcosbarbero / spring-boot2-oauth2-jwt Goto Github PK
View Code? Open in Web Editor NEWRead more http://blog.marcosbarbero.com/centralized-authorization-jwt-spring-boot2/
Read more http://blog.marcosbarbero.com/centralized-authorization-jwt-spring-boot2/
Starting server did not work. Did generating keystore.jks as documentation in https://dzone.com/articles/creating-self-signed-certificate said. Starting server with
oauth2-jwt-server $ mvn clean spring-boot:run
quits due to error.
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter]: Factory method 'jwtAccessTokenConverter' threw exception; nested exception is java.lang.IllegalStateException: Cannot load keys from store: class path resource [keystore.jks]
...
Caused by: java.lang.IllegalStateException: Cannot load keys from store: class path resource [keystore.jks]
at org.springframework.security.oauth2.provider.token.store.KeyStoreKeyFactory.getKeyPair (KeyStoreKeyFactory.java:67)
at com.amadeus.oauth.jwt.config.security.AuthorizationServerConfiguration.keyPair (AuthorizationServerConfiguration.java:102)
at com.amadeus.oauth.jwt.config.security.AuthorizationServerConfiguration.jwtAccessTokenConverter (AuthorizationServerConfiguration.java:75)
at com.amadeus.oauth.jwt.config.security.AuthorizationServerConfiguration$$EnhancerBySpringCGLIB$$36dcb130.CGLIB$jwtAccessTokenConverter$1 (<generated>)
at com.amadeus.oauth.jwt.config.security.AuthorizationServerConfiguration$$EnhancerBySpringCGLIB$$36dcb130$$FastClassBySpringCGLIB$$94772ca6.invoke (<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper (MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept (ConfigurationClassEnhancer.java:363)
at com.amadeus.oauth.jwt.config.security.AuthorizationServerConfiguration$$EnhancerBySpringCGLIB$$36dcb130.jwtAccessTokenConverter (<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
Could you please show an example on how can I get an authorization code for obtaining an access code?
Do we need to edit some configuration or its already working out of the box ?
I've tried the following URL as a sample:
http://localhost:9000/oauth/authorize?client_id=client_1&response_type=code&scope=read
but receiving
{
"timestamp": "2019-12-27T05:39:18.810+0000",
"status": 403,
"error": "Forbidden",
"message": "Access Denied",
"path": "/oauth/authorize"
}
Hi Marcos,
It too pretty good example you have put. it really helpful to developers.
i just want to know from you, about refresh token.
how we can refresh access token using refresh token ?
i will be fantastic if you provide me the any way-out.
Could you provide a basic example of replacing h2 provider to a relational db. Thanks
expires_in always is 299.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.