Keycloak server and Spring Boot app with user database - spring

im currently stuck for some time on this problem. I have Spring Boot app with JPA working with its own database of users and more things.
I want to add keycloak authorization server to it but i dont know how to add my spring boot app(or its endpoints) as user federation/user storage/user provider.
Can someone please point me to the right direction?

Related

Issue in migrating OAuth2 SSO provider of Spring boot application from one provider to another

I am working with migrating OAuth2 SSO provider for my Spring boot application from SSOProvider1 to SSOProvider2.
My application has been working fine with SSOProvider1. The relevant properties are as follows:
spring.security.oauth2.client.registration.ssprovider1.client-id=abcd
spring.security.oauth2.client.registration.ssprovider1.client-secret=1234
spring.security.oauth2.client.registration.ssprovider1.scope=api
spring.security.oauth2.client.registration.ssprovider1.client-authentication-method=basic
spring.security.oauth2.client.registration.ssprovider1.authorization-grant-type=authorization_code
spring.security.oauth2.client.provider.ssprovider1.token-uri=https://ssoprovidr1.base.com/token
spring.security.oauth2.client.provider.ssprovider1.authorization-uri=https://ssoprovidr1.base.com/authorize
spring.security.oauth2.client.provider.ssprovider1.user-info-uri=https://ssoprovidr1.base.com/userinfo
spring.security.oauth2.client.provider.ssprovider1.user-name-attribute=name
Now, as part of migration, for SSOProvider2, I have changed only following values:
spring.security.oauth2.client.registration.ssprovider2.client-id=efgh
spring.security.oauth2.client.registration.ssprovider1.client-secret=5678
spring.security.oauth2.client.registration.ssprovider2.scope=read
spring.security.oauth2.client.registration.ssprovider2.client-authentication-method=basic
spring.security.oauth2.client.registration.ssprovider2.authorization-grant-type=authorization_code
spring.security.oauth2.client.provider.ssprovider2.token-uri=https://ssoprovidr2.base.com/token
spring.security.oauth2.client.provider.ssprovider2.authorization-uri=https://ssoprovidr2.base.com/authorize
But, whenever I am starting my app and browsing the end-point, I am getting following error: Too many redirect and clearing the browser cookies also did not help.
I am not sure, why I am getting this error.
Could anyone please help here? Thanks.

Use single spring boot application as a Spring boot admin and client both

We have one application which is running on the Spring boot, We don't like to add a new application in the environment to manage this application, to do so we like to add spring boot admin feature to the same application. I tried that and able to see the spring admin screen but the client is not getting loaded.
I don't know this is good idea or not.
Please provide your suggestion.
I can see it is working both spring boot admin sever and client both application in one.
But I dont know this is good idea or not. Please provide your inputs
The Spring Boot Admin is invented for monitoring multiple services. In my opinion you should separate them so everyone will has it's job to follow the single responsibility principle. With separation when your application will fail the Spring Boot Admin will catch logs and maybe some additional data, if they are together you won't know what might happen.

Difference between spring-boot-admin server and client

There are no much resources on this topic so thought to post it. Also I myself am trying to understand the different. Previously we just had only spring-boot application. So can anybody explain the difference.
Spring boot admin is nice monitoring dashboard for spring boot application. To feed data to this dashboard spring boot admin provide two approaches:
1) Using client library: client libary will send data to spring boot admin dashboard.
2) Use service discovery (eureka)

Interaction between api gateway (Zuul) and UAA server (Spring OAuth2) with Spring Boot 2.0

I'm trying to build a system with an gateway server (Zuul), and UAA server (Spring OAuth2)
There's lots of examples but they are all used with Spring Boot 1 (1.5.X?). When I tried to migrate to Spring Boot 2, lots of things got moved or removed (in the auto-configure package).
My current understanding is that the gateway server will acts as an oauth2 client with sso. Hope someone can point me to the right direction.
Thanks.

How to configure Spring Boot Tomcat Basic Auth together with Spring Security?

I'm currently trying to make a Spring Boot app. I've managed to create successfully user authentication using LDAP and custom logic.
However, I'm trying to add another layer of security on top of that, something like "htaccess" to prevent unauthorized users from even seeing the web page (client requirement), as well as stop Google from indexing the page. This can be a single predefined user (doesn't need to be connected to ldap auth).
I've read about configuring the tomcat realm, tomcat-users etc. but since it's Spring Boot app with embedded tomcat, I can't find a place to successfully configure it.
Does anyone have any idea how to create such setup?

Resources