How to consume JAX WS SOAP Web Service that requires authentication using Python

Introduction In this tutorial we will see how to consume or call JAX WS based SOAP web service that requires authentication. We will use Python program to consume the SOAP service. In my other example I had shown how to call SOAP webservice using Python but that service did not require any authentication. We are going to use my existing JAX WS based SOAP service which I previously created using Java programming language. As the web service is language agnostic so we can build or consume the service using different…

Continue

PHP REST API Authentication using JWT

Here in this tutorial we will see how to use JWT (JSON Web Token) to authorize users and allow them to continue their works once they are logged in using their regular credentials (usernames and passwords). Users use their credentials to get the JWTs and continue their work until JWTs expire. We will not use any third party library to generate JWT in our example. We have seen how to generate and validate JWT using PHP language without using any third party library. Here we will use the same concept…

Continue

How to generate and validate JWT using PHP without using third party API

Introduction In this tutorial we will see how to generate and validate JWT (JSON Web Token) using PHP programming language without using any third party library or plugin. I would not explain here what is JWT and why JWT is used but you can find wonderful documentation in its own website. This example of generating and validating JWT does not use any third party library and you may tweak the source code according to your needs. We will have expiry time for security reason to avoid indefinite validity of the…

Continue

REST over Https with Client certificate Authentication

Introduction The tutorial, REST over HTTPS with client certificate authentication, will show you how we can use client certificate to handshake with server along with basic authentication for consuming the service. Even you can use header authentication along with client certificate to make more secure. I will create Spring Boot application on Spring REST API and build the application using both maven and gradle build tools. I will show here both server side code and client side code using Spring Boot framework so that server expects client to establish communication…

Continue

Spring Boot Security Angular 8 Login Logout Example

Introduction Here we will create Spring Boot Security Angular Login Logout Example which will show you how to integrate Spring Security with Angular 8 to login to the application. We will redirect user to the login page if user is not already logged in. Similarly we will redirect user to the home page if user is already logged in. Because if user logged in then there is no point of showing the login page again when user click on the browser’s back button. Spring Boot’s default security mechanism will ask…

Continue

JAX-WS SOAP Webservice Authentication Example using Spring Boot

Introduction Here we will create an example on JAX-WS SOAP Webservice authentication using Spring Boot framework. User needs to pass username and password in the header to authenticate a user before he or she can access the JAX-WS SOAP Webservice. We will apply two approaches to publish our endpoint using Apache CXF Spring Boot starter or JAX-WS Spring API. We have seen the similar authentication example without using Spring framework. We will use gradle tool to build our application.

Continue

Securing REST API: JWT Authentication using Python Flask

Introduction In this post we will see how to secure REST API with JWT authentication using Python Flask. JWT is an acronym for JSON Web Token. In previous example we have seen how to secure REST API using HTTP Basic Authentication which is not recommended for most of the time. Recommended Reading REST API CRUD Example using Python Flask and MySQL REST API CRUD Example using Python Flask and MongoDB

Continue

Securing REST API: Python Flask HTTP Basic Authentication

Introduction We will see an example on how to secure REST API using Python Flask. We will create a Python Flask HTTP Basic Authentication. Most of the web services that require authentication accept HTTP Basic Authentication. This is the simplest one, and request supports it straight out of the box. This HTTP basic authentication is not recommended as it is vulnerable to security threats. Recommended reading Securing Python Flask REST API with JWT

Continue

Spring Security – Authentication and Role Based Authorization using JWT

Introduction In this post we will see an example on Spring Security authentication and role based authorization using JWT (JSON Web Token) on REST or RESTful services. I won’t explain here about JWT as there is already very good article on JWT. We will implement Spring Security’s UserDetailsService to load user from database. We will use Spring JDBC API to perform database operations for fetching or saving user and roles into database. We will use H2 in-memory database to build a quick Spring Boot application. We will also use MySQL…

Continue

Spring Boot Security – Form Based Authentication – Persistence Token – Remember Me

Introduction The example Spring Boot Security form based authentication persistence token remember me will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based authentication remember me – persistent token – on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. We will add additional field as remember me into the login form. This tutorial will show you how to remember your credentials for a specific time period for auto-login without providing any login credentials into…

Continue