Giter Club home page Giter Club logo

sample-gateway-oauth2login's Introduction

OpenID Connect via Spring Cloud Gateway

Run the Sample

  • Build the sample → ./gradlew clean build

  • Run UAA Server → ./gradlew -b uaa-server/build.gradle uaa

  • Run Gateway → ./gradlew -b gateway/build.gradle bootRun

  • Run Resource Server → ./gradlew -b resource-server/build.gradle bootRun

  • Go to http://localhost:8080 and login to UAA using user1/password

sample-gateway-oauth2login's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-gateway-oauth2login's Issues

How to rediret to the login page when the jwt token expired?

Hi, your sample project is very helpful to me when i am learning the spring cloud gateway with my custom oauth2 authorization server(which is also called uaa, the difference is that my uaa has a smaller accessTokenValiditySeconds config to the client, eg: 60s), but i have encountered a problem, when i'm accessing my resource server through the gateway router, the first time i will be redirect to the uaa's login page, it works very well, but when the jwt is expired, the resource server just show a 401 error page, i think the right behavior should be redirected to the login page again, so what wrong with me? how can i fix this? and if the resource server is a restful api server, i think the 401 response will be well, how can i config a web site resource server and a restful api resource server separately? the problem confuse me several days, hope your help, thanks very very much!

Update readme

Hello!

Version 8 of Tomcat is now at 8.5.51, and when tried to install with 8.5.43, it crashed(Apparently, they remove old versions, so it gave me a not found exception). Changing in build.gradle would cause same thing, so it would be better to change README.adoc instead.

关于uua-service的实现文档

麻烦作者能不能把uua实现开源出来,一直没明白你这个gateway的配置文件yml里面的security路由怎么到这个uua服务的,搞这个搞了好久了,没搞明白

Google Bearer Token

It looks like the Access token that comes back from Google is not a base64 encoded JWT as expected by this example. It seems like what ends up being mapped is the access_token from this response. within this code:

.map(OAuth2AuthorizedClient::getAccessToken)
.map(token -> withBearerAuth(exchange, token))

Any advice on how you'd go about fixing that?

Thanks!

Error when updating to Spring Boot 2.2.0

The following is the runtime error:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tokenRelayGatewayFilterFactory' defined in class path resource [org/springframework/cloud/security/oauth2/gateway/TokenRelayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'tokenRelayGatewayFilterFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizedClientRepository' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/reactive/ReactiveOAuth2ClientConfigurations$ReactiveOAuth2ClientConfiguration.class]: Unsatisfied dependency expressed through method 'authorizedClientRepository' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizedClientService' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/reactive/ReactiveOAuth2ClientConfigurations$ReactiveOAuth2ClientConfiguration.class]: Unsatisfied dependency expressed through method 'authorizedClientService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientRegistrationRepository' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/reactive/ReactiveOAuth2ClientConfigurations$ReactiveClientRegistrationRepositoryConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.client.registration.InMemoryReactiveClientRegistrationRepository]: Factory method 'clientRegistrationRepository' threw exception; nested exception is java.lang.IllegalArgumentException: redirectUriTemplate cannot be empty

Dependencies out of date, sample no longer works

Downloading the project and following the README fails due to packages no longer existing in the repositories. (and thus can't be resolved)

Furthermore this sample has become quite outdated with the Gateway and Spring Boot, even the configuration options in the Gateway for Client Registration in Spring Security have changed structure.

I've submitted a PR for this #18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.