Search results for: Java

The below list of tutorials will help you learn how to test RESTful Web Services with the REST Assured framework. You might want to check the video tutorials page if you are interested in video tutorials. Testing RESTful Web Service API with REST Assured REST Assured HTTP Post Request ( Includes video tutorial ) REST Assured…

Read More Testing RESTful Web Services

This tutorial will teach you how to start your Spring Boot Web application on a different port number. Read the following tutorial to learn how to start your Spring Boot application on a random port number. By default, if no port number is configured, our Spring Boot Web application will start on port number 8080.…

Read More Start Spring Boot Application on a Different Port Number

In this short tutorial, you will learn how to configure the /logout functionality in your Spring Boot Web application that uses OAuth2 Social Login. To learn how to implement the OAuth2 Social login feature, please check the following tutorial: Spring Security OAuth 2 Social Login. Configure HttpSecurity Applications that use Spring Security and OAuth2 Social login…

Read More Spring Security OAuth 2 Social Logout

In this tutorial, you will learn how to add a Social Login(OAuth 2) feature into your Spring MVC Web application. This will allow users to login to your application with their social network accounts like Facebook, Google, or other large services that support OAuth 2 like for example GitHub. Spring Security 5 offers very good…

Read More Spring Security OAuth 2 Social Login

In this tutorial, you will learn how to get the currently authenticated principal user UserId value from the JWT access token generated by Keycloak. UserId in JWT The userId value will be stored under the “sub” key in the JWT access token generated by Keycloak. Below is an example of a decoded JWT access token containing…

Read More Get UserId from Keycloak JWT Access Token

  Classes in Swift  Create a new Class Implement a Singleton Class Class Extension example in Swift Comparable protocol. Compare custom objects Functions in Swift Declare a function in Swift Declare a function with a default parameter value Declare a function with variadic parameters in Swift Nested Functions in Swift: A Comprehensive Guide Swift Closures Swift Closure:…

Read More Swift Code Examples

In this tutorial, you will learn how to use @AuthenticationPrincipal annotation to get the Jwt object containing the details of a provided in HTTP Request access token. When we send a request containing an access token in the Authorization header, behind the scenes,  Spring Framework will do a lot of work and if all is good,…

Read More @AuthenticationPrincipal – Getting the Jwt Claims

In this tutorial, you will learn how to use an OAuth 2 Implicit Grant Type authorization flow to acquire an access token from an authorization server. The Implicit Grant Type was previously recommended for native apps and JavaScript apps where the access token was returned immediately without an extra authorization code exchange step. When following…

Read More OAuth 2 Implicit Grant Type Flow Example

By default, Spring Boot RESTful web service endpoints consume and produce JSON representations. However, it’s possible to enable consuming XML and producing it for your REST API endpoints with minimal effort. This tutorial will guide you through the process of adding XML support to your Spring Boot application, allowing consuming XML and producing representations of…

Read More Consuming XML in Spring Boot REST

In this tutorial, you will learn how to create both a one-dimensional and multidimensional arrays in Swift. After reading this tutorial, you might also be interested in learning how to use FlatMap and Map when working with arrays. How to Use flatMap in Swift. Code Examples, How to Use map(_:) in Swift. Code Examples, Ways…

Read More Multidimensional Array Example in Swift

In this tutorial, you will learn how to create an instance of @LoadBalanced RestTemplate and make it communicate with an internal microservice. For a step-by-step series of video lessons, please check this page: Spring Boot Microservices and Spring Cloud. Create RestTemplate Bean To create an instance of RestTemplate, you will need to first make sure…

Read More @LoadBalanced RestTemplate Call Internal Microservice

In this Spring Security tutorial, you will learn how to use the @PreAuthorize annotation to secure method invocation. You can use the @PreAuthorize annotation to secure either method in a Controller class or a method in a service layer class. There are other useful method-level security annotations like the ones below. It is useful to…

Read More Spring Security @PreAuthorize Annotation Example

In this tutorial, I will share how to generate a self-signed certificate and enable HTTPS/SSL support in a Spring Boot application. You will also learn how to configure the RestTemplate HTTP client to use the same self-signed certificate to communicate with your Web Service over HTTPS. Let’s start by generating a self-signed certificate. Generate Self-Signed…

Read More Enable HTTPs/SSL in Spring Boot App