Angular Okta SSO Role Based Access

Table of Contents Introduction Prerequisites Project Setup Install okta-auth-js Service Auth Service Token Service Auth Guard Components Implementing Okta Auth Role Based Access Environment Variables App Modules Routing Module Token Service Auth Service Auth Guard Expired Component Unauthorized Component Login Component App Component Dashboard Component Protected Component Update Page Testing Okta SSO Role Based Access Source Code Introduction In this…

Spring Boot RabbitMQ Producer Consumer Example

Table of Contents Introduction Prerequisites Project Setup Application Properties Producer Consumer Configuration Spring Boot RabbitMQ Main Class Testing Producer Consumer Application Source Code Introduction In this tutorial I will show you how to build producer consumer example using Spring Boot and RabbitMQ. This is also called point-to-point messaging model as there are only one producer or sender and only one…

Redirect To Context Path For 404 Error In Angular Spring Boot

Table of Contents Introduction Why Does 404 Error Occur Solution Introduction Here in this tutorial I am going to show you how to redirect to context path for 404 error in Angular Spring Boot application. Context path basically is the same path for home page or root URL. It is assumed that your frontend application is built using Angular and…

How To Setup Multiple Environments For Angular Applications

Introduction Here I am going to tell you how to setup multiple environments for Angular applications. Multiple environments are required for your Angular application when you want to ensure the stability and integrity of the application when it goes live on the production environment where your application’s end users access it. Your application’s development workspace should be different from your…

RabbitMQ – access to vhost ‘xyz’ refused for user ‘guest’

Problem Let’s say you are starting your Spring Boot application and your (Spring Boot) application is trying to connect to vhost (virtual host) ‘xyz’ that does not exist in RabbitMQ server. So, you are getting error – access to vhost ‘xyz’ refused for use ‘guest’. By default, the user which is used to connect to RabbitMQ is ‘guest’. Here the vhost ‘xyz’ is not the…

HTML Script Integrity Attribute – SubRresource Integrity (SRI)

What is integrity attribute? You might have seen the integrity attribute as well as crossorigin attribute in web page source code. The integrity and crossorigin attributes are used in the <script> and <link> tags. This is also called subresource integrity because it is included into the third party resources which are parts of the HTML pages. An integrity attribute’s value…

Intellij IDEA Error – Command Line Is Too Long

Problem Here I am going to tell you how you can solve the problem when you try to run Java main class in Spring Boot application from IntellijIDEA. The actual error you would find as given below:

Spring RestTemplate With Auth Token, Proxy and Timeout

Introduction Here I am going to tell you how to use proxy server and timeout with Spring Boot RestTemplate API. If you are running your application behind a proxy server then you need to connect to REST API through proxy server and without proxy server connection you may face connection timeout error or other errors. Remember if you are behind the proxy…

How To Exclude Dependencies In Gradle Based Java Project

Table of Contents Introduction Prerequisites Exclude Dependencies/Libraries Exclude Per Configuration Exclude Per Dependency Introduction I am going to show you how to exclude dependency from build.gradle script in gradle based Java project. Specially when you use several starter dependencies in your Spring Boot project, then many children dependencies are found and hence many libraries are downloaded in the project’s classpath. These many libraries may not be needed for your…

Find Dependency Tree Hierarchy In Gradle Based Java Project

Introduction In this example, I am going to show you how to find dependency hierarchy using gradle build tool in your Java based projects. Your Spring Boot projects might be using gradle build tool and you want to check what dependencies are used in your project. You can easily find what libraries are used in your project by looking into the content of the build.gradle script,…