Posts

Showing posts with the label kotlin

Kotlin - Spring Security - Google OAuth2 Login - Example

Image
Hello everyone, Today we are going to learn how to integrate the Google OAuth2 Sign-In by utilizing the Kotlin + Spring Boot application with Gradle build. More Spring Security practice: Kotlin - Spring Security -GitHub OAuth2 Login - Example Spring Boot - Spring Security -Google OAuth2 Login - Example Spring Boot - Spring Security -GitHub OAuth2 Login - Example Registration and Login with Spring Boot + Spring Security + Thymeleaf Spring Boot-Authentication and Authorization with Spring Security & JWT   Generate Google OAuth2 credentials from Google developer console 1.  Log in  to the Google developer console using your Google account 2. Navigate to the Credentials section on the left menu, and choose the OAuth client ID option 3. Choose the application type, In our case "Web application". 4. Then, provide application name, Authorized javascript origins, authorized redirect URIs, and select the create option 5. After clicking the create button, one modal will pop up with

Kotlin + Spring Webflux File Download - REST API Example

Image
In this section, we will show you how to download files in a RESTful Kotlin + Spring WebFlux application. More Spring WebFlux practice: Kotlin + Spring Webflux File Upload (Single/Multiple)- REST API Example Spring Webflux File Upload (Single/Multiple)- REST API Example Spring Webflux File Download - REST API Example Reactive Rest CRUD APIs using Spring Boot, WebFlux, and Reactive Mongo Technologies used: Kotlin Spring Boot 2.5.4 Spring Webflux Java 11 Gradle Project Strcuture: Project Dependency Management(build.gradle.kts)  Spring boot dependencies, no need for an extra library for file upload. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id( "org.springframework.boot" ) version "2.5.4" id( "io.spring.dependency-management" ) version "1.0.11.RELEASE" kotlin( "jvm" ) version "1.5.21" kotlin( "plugin.spring" ) version "1.5.21" } group = "com.knf.dev.demo" version =

Kotlin + Spring Webflux File Upload - Single&Multiple - REST API Example

Image
This article shows you how to upload single|multiple files in the Kotlin + Spring Webflux application.  More Spring WebFlux practice: Kotlin + Spring Webflux File Download - REST API Example Spring Webflux File Upload (Single/Multiple)- REST API Example Spring Webflux File Download - REST API Example Reactive Rest CRUD APIs using Spring Boot, WebFlux, and Reactive Mongo Technologies Used: Kotlin Spring Boot 2.5.4 Spring Webflux Java 11 Gradle Project Structure: Project Dependency(build.gradle.kts) Spring boot dependencies, no need for an extra library for file upload. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id( "org.springframework.boot" ) version "2.5.4" id( "io.spring.dependency-management" ) version "1.0.11.RELEASE" kotlin( "jvm" ) version "1.5.21" kotlin( "plugin.spring" ) version "1.5.21" } group = "com.knf.dev.demo" version = "0.0.1-SNAPSHOT" j

Kotlin + Spring Boot + iText PDF - Export data to PDF example

Image
Hello everyone, today we will learn how to export and download the data as a PDF file in a Kotlin, Spring Boot project. PDF stands for the Portable Document Format, used to exhibit documents in an electronic form independent of the software, hardware, or operating system they are viewed on. Technologies used: Spring Boot  Kotlin iText PDF H2DB Spring Data JPA Project Directory: Gradle Build(build.gradle.kts)   import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id( "org.springframework.boot" ) version "2.5.4" id( "io.spring.dependency-management" ) version "1.0.11.RELEASE" kotlin( "jvm" ) version "1.5.21" kotlin( "plugin.spring" ) version "1.5.21" kotlin( "plugin.jpa" ) version "1.5.21" } group = "com.knf.dev" version = "0.0.1-SNAPSHOT" java.sourceCompatibility = JavaVersion.VERSION_11 repositories { mavenCentral() } dependencies { im