keycloak version to use with (react, spring boot, postgres) - reactjs

what is the best version of keycloak to use with spring boot as backend and react as frontend and I can setup easily with a postgres database, I've tested the latest version 19.0.1 but I couldn't set it up with react and spring boot and it doesn't take the postgres DB I specified in env variables.
can you please suggest me the best version to use and some tutorials, videos or articles to learn more about it and how to implement it in production.
thanks in advance.

I recommand you don't use Keycloak Spring adapters, it is deprecated.
The latest Keycloak version works perfectly. Maybe you just misconfigured or use the wrong libs.
For client (react app), pick a library from certified list
For resource-server (Spring REST API), use either:
spring-boot-starter-oauth2-resource-server (but require quite some Java conf)
spring-addons-webmvc-jwt-resource-server (a lot is configurable from properties, including CORS and roles mapping)
Regarding the connection to Postgres, maybe should you return to the doc and read more carefully.

I'd recomend using the keycloak-spring-boot-starter.
Here is an article on how to set it up: https://www.baeldung.com/spring-boot-keycloak
I would also recomend to always use the most recent version. Especially for a security tool like keycloak. If it doesn't work with the tutorial just set it up in the version the tutorial references and then migrate to a newer version step by step using migration guides.

Related

MSAL vs msgraph-sdk-java-auth

I want to develop a Java Web App to consume some Microsoft Graph Services. According to Azure Portal's "Quick Start" tab, they recommend MSAL to authenticate and call the services (com.microsoft.aad.msal4j.*).
On the other hand, I've found https://github.com/microsoftgraph/msgraph-sdk-java-auth, which offers a nice API to use the services, but the last uptade is from more than a year.
Which should I use? I'm a bit afraid the SDK gets deprecated.
Thanks.
If you have a look at the dotnet version of this library, you'll see it uses MSAL. Whenever the Java msgraph auth library was started, MSAL Java wasn't ready. There's work that needs to be done to align the Java auth library with the dotnet one so it uses MSAL as well. I'd say go ahead and use the Java auth library keeping in mind a few things:
It will change as the required work gets done
Auth libraries for msgraph SDKs are all in preview and might change in the future
There's currently a limitation addressed by this pull request and that you can workaround as documented here

SSL (HTTPS) support in functional web framework

How am I supposed to to configure SSL for a Spring Boot Service using the functional web framework?
The configuration via setting server.ssl.* properties does not work (meaning nothing happens at all) and if I am reading the docs right, only server.port and server.address are supported.
As runtime I prefer netty, but I would be fine with tomcat as well.
Indeed, using the server.ssl.* configuration keys is the right way to go. This is not yet supported as of Spring Boot 2.0.0.M5, but it will be in a future Milestone version (you can follow issue #9431 for that).
You could use customizers as a workaround; Spring Boot provides a few of those for Tomcat already (see TomcatConnectorCustomizer), but unfortunately not yet for Netty (see #10418).
In the meantime, you can provide your own ReactiveWebServerFactory bean and manually set up your Netty server to do that.

Authenticate against Active Directory in .NET Core 1.0 application?

With the recent release of .NET Core 1.0, we're in the process of migrating our RC1 applications to the final release. The only piece we can't seem to figure out is how to integrate Active Directory authentication.
Previously in the RC1 applications, we had used the System.DirectoryServices.AccountManagement library to handle the LDAP authorization queries. However, we can no longer mix this library with .NET Core v1.
Generally, what is the best way to integrate Active Directory authentication into our applications using the libraries available for use in the .NET Core framework? IdentityServer, some other third party service like Auth0 or something else?
The Novell.LDAP library has been ported to .NET Core you can find it in NuGet. There are numerous samples available, including a verify password sample.
Best is subjective, really there's only one way right now, given the missing DirectoryServices namespace (which is planning for 1.1) - federation.
You'd have to install ADFS, and expose it to the internet. Then you configure it to act as an OAuth2 endpoint, and use the generic OAuth middleware to redirect logins to your ADFS server. You could also install the latest ADFS beta, which needs the latest Windows Server beta, and use OpenID Connect, but that's a lot of beta risks you may not find acceptable.
Or, if you just want the latest MVC pieces, run it on .NET Desktop, where you have full access to the directory services namespace.
The System.DirectoryServices namespace is currently being implemented in .NET Core, work is ongoing.
https://github.com/dotnet/corefx/issues/2089
Just want to say that they just issued a pre-release of the Microsoft.Windows.Compatibility which contains the System.DirectoryServices components needed to integrating with Active Directory
https://www.nuget.org/packages/Microsoft.Windows.Compatibility/2.0.0-preview1-25914-04

Need to know the way to work with Apache Camel

I am new to Apache Camel. I have read several documentation of it and went through the examples (only of XML DSL) that Apache provide with its jar. I have a spring MVC project running over tomcat, and in the same project I need to include an Integration Framework. I have installed JBoss plugin for tooling so that I can drag and drop components but palette isn't showing any component but a message 'A palette is not working'. So, please suggest me how should I proceed to implement the same. For now I am referring Camel in Action. And, if possible, then provide an example to send a https request to any URL with some header parameters and transform its response and print it on console or write it to any file or give another https request to any other URL with the payload.
you mentioned that you installed the JBoss plugin for tooling, do you mean that you installed the JBoss Fuse Tooling?
Which version of Eclipse or JBoss Developer Studio are you using? Which OS are you using?
In Fuse Tooling, several examples are provided based on archetypes, I let you check the "CHAPTER 5. CREATING A NEW FUSE PROJECT" in
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/pdf/Tooling_User_Guide/Red_Hat_JBoss_Fuse-6.2.1-Tooling_User_Guide-en-US.pdf

Is there any restful api for postgresql?

Im trying to develop a web app using angularjs, restangular and postgresql, im using ubuntu and xampp for development. I found ArrestDB, a restful api for postgresql. In its documentation,
# Get all rows from the "customers" table where the "country" field matches "Australia" (LIKE)
GET http://api.example.com/customers/country/Australia/
https://github.com/alixaxel/ArrestDB
While in restangular documentation,
// Just ONE GET to /accounts/123/buildings/456
Restangular.one('accounts', 123).one('buildings', 456).get()
https://github.com/mgonto/restangular
Do you guys know a free RESTful api for postgresql that works well with restangular?
ArrestDB interprets api/{Table}/{Field}/{....} while Restangular interprets api/{table}/{id}/{relations table}. I also tried api/{table}/{id}/{relations table} in ArrestDB but I get error 404.
I also found Postgrest in github but its in haskel, and i'm not familiar with haskel.
Thanks...
Postgrest seems to be a very viable choice. There is no knowledge of Haskell required to interact with it.
I have used PostgREST and recommend it. It is written in Haskell but requires no knowledge of Haskell (in the same way that pg is written in C, but no knowledge of C is required to use it). The documentation at postgrest.com is quite helpful and I've been able to get up to speed with it quickly. Best practices are to run pgREST through a reverse proxy (Apache, Nginx, etc.) to control web authentication and authorization. PostgreSQL will enforce permissions GRANTed to the configured pgREST user (INSERT, UPDATE, DELETE, etc.) on the DB served up by pgREST. There are a number of access control options listed in the pgREST documentation for switching user roles as requests come in, so the access control is pretty flexible in accommodating different usage scenarios.
You can use Express.js and Node.js to create RESTful API for example. It works with PostgreSQL well. I am using it now for my application, so I have a PostgreSQL DB, back-end in Express.js with pg-promise and Node.js and front-end in AngularJS with Restangular.
You can try
this tutorial,
this guy has a quite good blog about building API and other useful things.

Resources