Skip to content

indiepopart/spring-data-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial: A Quick Guide to Elasticsearch for Spring Data and Spring Boot

This repository contains all the code for the Spring Data Elasticsearch tutorial, illustrating the JHipster support for the Elasticsearch engine in Spring Boot applications.

Prerequisites:

Getting started

To install this example, first clone this repository:

git clone https://github.com/indiepopart/spring-data-elasticsearch.git

Configure Okta authentication

cd spring-data-elasticsearch

With OktaCLI, register for a free developer account:

okta register

Provide the required information. Once you complete the registration, create the OIDC client applications.

cd spring-data-elasticsearch
okta apps create jhipster

You will be prompted to select the following options:

The OktaCLI will create the client application and configure the issuer, clientId and clientSecret in an .okta.env file in the application root folder.

Run with Docker Compose

In the blog and gateway root, generate the application container image with the following Maven command:

./mvnw -DskipTests -ntp -Pprod verify jib:dockerBuild

Edit the file docker-compose/central-server-config/application.yml and replace the placeholders with the values from .okta.env:

spring:
  security:
    oauth2:
      client:
        provider:
          oidc:
            issuer-uri: https://{yourOktaDomain}/oauth2/default
        registration:
          oidc:
            client-id: {clientId}
            client-secret: {clientSecret}

Go to the docker folder and run the services with Docker Compose:

cd docker-compose
docker compose up

Once the services are up, go to http://localhost:8080 and login with your Okta credentials.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published