Skip to content
Snippets Groups Projects
Commit 8dee8288 authored by Julian Horner's avatar Julian Horner
Browse files

Add config, filter and service packages and minor improvements

parent 54107e24
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/** /**
* Authentication service for microservice architecture. * Class for starting authentication service.
* *
* @author Julian * @author Julian
* *
...@@ -21,11 +21,11 @@ public class Application { ...@@ -21,11 +21,11 @@ public class Application {
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
/** /**
* Starts the application. * Start the application.
* *
* @param args The arguments * @param args The arguments
*/ */
public static void main(final String[] args) { SpringApplication.run(Application.class, args); } public static void main(String[] args) { SpringApplication.run(Application.class, args); }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
} }
/* /*
* Copyright 2019 (C) by Julian Horner. * Copyright 2019 (C) by Julian Horner.
* All Rights Reserved. * All Rights Reserved.
*/ */
package de.rtuni.ms.as; package de.rtuni.ms.as.config;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
/** /**
* Configuration class for json web token. * Configuration class for JWT.
* *
* @author Julian * @author Julian
* *
*/ */
public class JwtConfig { public class JWTConfiguration {
//---------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
@Value("${security.jwt.uri:/auth/**}") /** Get the URI where the credentials needs to be send. */
private String Uri; @Value("${security.jwt.uri:/auth/**}")
private String Uri;
@Value("${security.jwt.header:Authorization}")
private String header; /** Get the header authorization type. */
@Value("${security.jwt.header:Authorization}")
@Value("${security.jwt.prefix:Bearer}") private String header;
private String prefix;
/** Get the prefix of the token message. */
@Value("${security.jwt.expiration:#{24*60*60}}") @Value("${security.jwt.prefix:Bearer}")
private int expiration; private String prefix;
@Value("${security.jwt.secret:JwtSecretKey}") /** Get the expiration of the token in seconds. */
private String secret; @Value("${security.jwt.expiration:#{24*60*60}}")
private int expiration;
//----------------------------------------------------------------------------------------------
/** Get the key for encryption and decryption. */
/** @Value("${security.jwt.secret:JwtSecretKey}")
* Get the uri. private String secret;
*
* @return The uri //---------------------------------------------------------------------------------------------
*/
public String getUri() { return Uri; } /**
* Get the URI where the credentials needs to be send.
/** *
* Get the header. * @return The stated URI
* */
* @return The header public String getUri() { return Uri; }
*/
public String getHeader() { return header; } /**
* Get the header authorization type.
/** *
* Get the prefix. * @return The stated header
* */
* @return The prefix public String getHeader() { return header; }
*/
public String getPrefix() { return prefix; } /**
* Get the prefix of the token message.
/** *
* Get the expiration. * @return The stated prefix
* */
* @return The expiration public String getPrefix() { return prefix; }
*/
public int getExpiration() { return expiration; } /**
* Get the expiration of the token in seconds.
/** *
* Get the secret. * @return The stated expiration
* */
* @return The secret public int getExpiration() { return expiration; }
*/
public String getSecret() { return secret; } /**
* Get the the key for encryption and decryption.
//---------------------------------------------------------------------------------------------- *
} * @return The stated secret
*/
public String getSecret() { return secret; }
//---------------------------------------------------------------------------------------------
}
/* /*
* Copyright 2019 (C) by Julian Horner. * Copyright 2019 (C) by Julian Horner.
* All Rights Reserved. * All Rights Reserved.
*/ */
package de.rtuni.ms.as; package de.rtuni.ms.as.config;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
/** import de.rtuni.ms.as.filter.JWTUsernameAndPasswordAuthenticationFilter;
* Class that enables custom security configuration.
* /**
* @author Julian * Class that handles several security configurations.
* *
*/ * @author Julian
@EnableWebSecurity *
public class SecurityConfiguration extends WebSecurityConfigurerAdapter { */
//---------------------------------------------------------------------------------------------- @EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
/** A service that loads users from the database. */ //---------------------------------------------------------------------------------------------
@Autowired
private UserDetailsService userDetailsService; /** The <code>JwtConfiguration</code>. */
@Autowired
/** The <code>JwtConfig</code> for the json web token. */ private JWTConfiguration jwtConfiguration;
@Autowired
private JwtConfig jwtConfig; /** The service that loads users from the database. */
@Autowired
//---------------------------------------------------------------------------------------------- private UserDetailsService userDetailsService;
/** //---------------------------------------------------------------------------------------------
* Overrides the default configuration.
*/ /**
@Override * Get a new <code>JwtConfiguration</code>.
protected void configure(HttpSecurity http) throws Exception { *
http.csrf().disable() * @return The stated JWT configuration
// make sure we use stateless session; session won't be used to store user's state. */
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() @Bean
// handle an authorized attempts public JWTConfiguration jwtConfiguration() { return new JWTConfiguration(); }
.exceptionHandling().authenticationEntryPoint(
(req, rsp, e) -> { //---------------------------------------------------------------------------------------------
rsp.setContentType("application/json");
rsp.setCharacterEncoding("UTF-8"); /**
rsp.sendError(HttpServletResponse.SC_UNAUTHORIZED); * Get a new <code>BCryptPasswordEncoder</code>.
} *
).and() * @return The stated encoder
*/
/* @Bean
* Add a filter to validate user credentials and add token in the response header. public BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); }
*
* What's the authenticationManager()? An object provided by WebSecurityConfigurerAdapter, //---------------------------------------------------------------------------------------------
* used to authenticate the user passing user's credentials. The filter needs this
* authentication manager to authenticate the user. /**
*/ * Configure custom security configurations.
.addFilter(new JwtUsernameAndPasswordAuthenticationFilter( */
authenticationManager(), jwtConfig)) @Override
.authorizeRequests() protected void configure(HttpSecurity http) throws Exception {
// allow all POST requests http.csrf().disable()
.antMatchers(HttpMethod.POST, jwtConfig.getUri()).permitAll() // Use stateless sessions.
// any other requests must be authenticated .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.anyRequest().authenticated();
} // Response if the user is unauthenticated.
.exceptionHandling().authenticationEntryPoint(
// TODO improve comment (req, rsp, e) -> {
/** rsp.setContentType("application/json");
* Spring has <code>UserDetailsService</code> interface, which can be overridden to provide our rsp.setCharacterEncoding("UTF-8");
* implementation for fetching user from database (or any other source). rsp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
* <p> }
* The <code>UserDetailsService</code> object is used by the authentication manager to load the ).and()
* user from database. In addition, we need to define the password encoder also. So,
* authentication manager can compare and verify passwords. // Add a filter to validate user credentials with every request.
*/ .addFilter(new JWTUsernameAndPasswordAuthenticationFilter(
@Override authenticationManager(), jwtConfiguration))
protected void configure(AuthenticationManagerBuilder auth) throws Exception { // The passed authentication manager is build in the configure() method below.
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
} .authorizeRequests()
// Permit all POST requests to auth path.
//---------------------------------------------------------------------------------------------- .antMatchers(HttpMethod.POST, jwtConfiguration.getUri()).permitAll()
// Any other request must be authenticated.
/** .anyRequest().authenticated();
* Get a new <code>JwtConfig</code>. }
*
* @return The stated configuration /**
*/ * The auth manager will use our implementation of the <code>UserDetailsService</code>
@Bean * interface to load the user. In addition, we define a password encoder so that the
public JwtConfig jwtConfig() { return new JwtConfig(); } * authentication manager is able to compare and verify passwords.
*/
//---------------------------------------------------------------------------------------------- @Override
protected void configure(AuthenticationManagerBuilder authManagerBuilder) throws Exception {
/** authManagerBuilder.userDetailsService(userDetailsService)
* Get a new <code>BCryptPasswordEncoder</code>. .passwordEncoder(passwordEncoder());
* }
* @return The stated encoder
*/ //---------------------------------------------------------------------------------------------
@Bean }
public BCryptPasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); }
//----------------------------------------------------------------------------------------------
}
/* /*
* Copyright 2019 (C) by Julian Horner. * Copyright 2019 (C) by Julian Horner.
* All Rights Reserved. * All Rights Reserved.
*/ */
package de.rtuni.ms.as; package de.rtuni.ms.as.filter;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.FilterChain; import javax.servlet.FilterChain;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.jsonwebtoken.Jwts; import de.rtuni.ms.as.config.JWTConfiguration;
import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
/**
* Filter class for json web token authentication of user name and password. /**
* * Filter class for authentication of user credentials, generating a JWT and adding the token to
* @author Julian * the response.
*/ *
public class JwtUsernameAndPasswordAuthenticationFilter * @author Julian
extends UsernamePasswordAuthenticationFilter { */
//---------------------------------------------------------------------------------------------- public class JWTUsernameAndPasswordAuthenticationFilter
extends UsernamePasswordAuthenticationFilter {
/** We use auth manager to validate the user credentials */ //---------------------------------------------------------------------------------------------
private AuthenticationManager authManager;
/** The <code>JwtConfiguration</code>. */
/** The configuration for the json web token. */ private JWTConfiguration jwtConfiguration;
private final JwtConfig jwtConfig;
/** The <code>AuthenticationManager</code> for validating user credentials. */
//---------------------------------------------------------------------------------------------- private AuthenticationManager authManager;
/** //---------------------------------------------------------------------------------------------
* Creates an instance with the given <code>AuthenticationManager</code> and the given
* <code>JwtConfig</code>. /**
* * Creates an instance with the given <code>AuthenticationManager</code> and the given
* @param authManager The stated manager * <code>JWTConfiguration</code>.
* @param jwtConfig The stated configuration for json web token *
*/ * @param authManager The stated manager
public JwtUsernameAndPasswordAuthenticationFilter(AuthenticationManager authManager, * @param config The stated configuration
JwtConfig jwtConfig) { */
this.authManager = authManager; public JWTUsernameAndPasswordAuthenticationFilter(AuthenticationManager authManager,
this.jwtConfig = jwtConfig; JWTConfiguration config) {
this.authManager = authManager;
// By default, UsernamePasswordAuthenticationFilter listens to "/login" path. this.jwtConfiguration = config;
// In our case, we use "/auth". So, we need to override the defaults.
this.setRequiresAuthenticationRequestMatcher( // Overrides default path of UsernamePasswordAuthenticationFilter with auth path.
new AntPathRequestMatcher(jwtConfig.getUri(), "POST")); this.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher(
} config.getUri(), "POST"));
}
//----------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
/**
* Read the credentials from the given request and tries to authenticate them. /**
*/ * Read the credentials from the given request, tries to authenticate them and returns the
@Override * authenticated user token, or null if authentication is incomplete.
public Authentication attemptAuthentication(HttpServletRequest requ, HttpServletResponse resp) */
throws AuthenticationException { @Override
try { public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res)
// Reads the credentials from the request body throws AuthenticationException {
// and put them in a newly created UserCredentials object. try {
UserCredentials credentials = // Reads the credentials from the request and put them in an UserCredentials object.
new ObjectMapper().readValue(requ.getInputStream(), UserCredentials.class); UserCredentials credentials = new ObjectMapper().readValue(
req.getInputStream(), UserCredentials.class);
// Creates an authentication token object with the credentials from the request // Creates a spring object for representing the credentials and inserts the previously
UsernamePasswordAuthenticationToken authToken = new UsernamePasswordAuthenticationToken( // created informations into it.
credentials.getUsername(), credentials.getPassword(), Collections.emptyList()); UsernamePasswordAuthenticationToken userPassAuth =
new UsernamePasswordAuthenticationToken(
// The manager tries to authenticate, it uses the loadUserByUsername() method in credentials.getUsername(),
// UserDetailsServiceImpl to load one of the embedded user. credentials.getPassword(),
return authManager.authenticate(authToken); Collections.emptyList()
} catch (IOException e) { );
throw new RuntimeException(e);
} // The manager tries to authenticate the credentials.
} return authManager.authenticate(userPassAuth);
} catch (IOException e) { throw new RuntimeException(e); }
//---------------------------------------------------------------------------------------------- }
/** //---------------------------------------------------------------------------------------------
* Upon successful authentication, generate a token. The given <code>Authentication<code> object
* is the current authenticated user. /**
*/ * Will be executed only upon successful authentication. Generate a token for the
@Override * <code>Authentication</code> object that is returned from the
protected void successfulAuthentication(HttpServletRequest requ, HttpServletResponse resp, * <code>attemptAuthentication()</code> method.
FilterChain chain, Authentication auth) throws IOException, ServletException { */
Long now = System.currentTimeMillis(); @Override
protected void successfulAuthentication(HttpServletRequest req, HttpServletResponse res,
// Building of the token FilterChain chain, Authentication auth) throws IOException, ServletException {
String token = Jwts.builder().setSubject(auth.getName()) Long now = System.currentTimeMillis();
// Convert authorities to list of strings // Builds the token
// This is important because it affects the way we get them back in the Gateway String token = Jwts.builder().setSubject(auth.getName())
.claim("authorities", // Converts the authorities to Strings and append them to the builder.
auth.getAuthorities().stream().map(GrantedAuthority::getAuthority) .claim("authorities", auth.getAuthorities().stream()
.collect(Collectors.toList())) .map(GrantedAuthority::getAuthority)
.setIssuedAt(new Date(now)) .collect(Collectors.toList()))
.setExpiration(new Date(now + jwtConfig.getExpiration() * 1000)) .setIssuedAt(new Date(now))
.setExpiration(new Date(now + jwtConfiguration.getExpiration() * 1000))
// Sign the token with a hash-based message authentication code,sha256 hash function
// and the given secret // Signs the token with a hash-based message authentication code, a sha256 hash
.signWith(SignatureAlgorithm.HS512, jwtConfig.getSecret().getBytes()).compact(); // function and the given secret.
.signWith(SignatureAlgorithm.HS512, jwtConfiguration.getSecret().getBytes())
// Add token to the header // Builds the JWT.
resp.addHeader(jwtConfig.getHeader(), jwtConfig.getPrefix() + token); .compact();
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
} res.setStatus(HttpServletResponse.SC_NO_CONTENT);
// Add token to the Authorization header.
//---------------------------------------------------------------------------------------------- res.addHeader(jwtConfiguration.getHeader(), jwtConfiguration.getPrefix() + token);
}
/**
* A (temporary) class to represent the user credentials. //---------------------------------------------------------------------------------------------
*
* @author Julian /**
* * A (temporary) class for representing user credentials.
*/ *
@SuppressWarnings("unused") * @author Julian
private static class UserCredentials { *
private String username; */
private String password; @SuppressWarnings("unused")
private static class UserCredentials {
public String getUsername() { return username; } private String username;
private String password;
public void setUsername(final String value) { username = value; }
public String getUsername() { return username; }
public String getPassword() { return password; } public void setUsername(final String value) { username = value; }
public void setPassword(final String value) { password = value; } public String getPassword() { return password; }
public void setPassword(final String value) { password = value; }
}
}
//----------------------------------------------------------------------------------------------
} //---------------------------------------------------------------------------------------------
}
/* /*
* Copyright 2019 (C) by Julian Horner. * Copyright 2019 (C) by Julian Horner.
* All Rights Reserved. * All Rights Reserved.
*/ */
package de.rtuni.ms.as; package de.rtuni.ms.as.service;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* Class that is able to load users. * Class that is able to load users.
* *
* @author Julian * @author Julian
*/ */
@Service @Service
public class UserDetailsServiceImpl implements UserDetailsService { public class UserDetailsServiceImpl implements UserDetailsService {
//---------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
/** The password encoder. */ /** The password encoder. */
@Autowired @Autowired
private BCryptPasswordEncoder encoder; private BCryptPasswordEncoder encoder;
//---------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
/** /**
* Loads a user by the given name. * Load a user by the given name.
* *
* @param The stated name * @param The stated name
*/ */
@Override @Override
public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException { public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {
// hard coding users. All passwords must be encoded. // Hard coding users, all passwords are encoded.
final List<AppUser> users = Arrays.asList( final List<AppUser> appUsers = Arrays.asList(
new AppUser(1, "julian", encoder.encode("12345"), "USER"), new AppUser(1, "default", encoder.encode("12345"), "USER"),
new AppUser(2, "admin", encoder.encode("12345"), "ADMIN")); new AppUser(2, "admin", encoder.encode("12345"), "ADMIN"));
for (AppUser appUser : users) { String userRole;
if (appUser.getUsername().equals(username)) { for (AppUser appUser : appUsers) {
/* if (appUser.getUsername().equals(username)) {
* Remember that Spring needs roles to be in this format: "ROLE_" + userRole // Spring needs roles to be in a format like "ROLE_" + user role.
* (i.e."ROLE_ADMIN") userRole = "ROLE_" + appUser.getRole();
* So, we need to set it to that format, so we can verify and compare roles
* (i.e. hasRole("ADMIN")). List<GrantedAuthority> grantedAuthorities =
*/ AuthorityUtils.commaSeparatedStringToAuthorityList(userRole);
List<GrantedAuthority> grantedAuthorities =
AuthorityUtils.commaSeparatedStringToAuthorityList( // Since a specific Spring object has to be returned for the method,
"ROLE_" + appUser.getRole()); // we convert our user into this object.
return new User(appUser.getUsername(), appUser.getPassword(), grantedAuthorities);
/* }
* The "User" class is provided by Spring and represents a model class for user to }
* be returned by UserDetailsService and used by authentication manager to verify
* and check use authentication. // If the user is not found an exception is thrown.
*/ throw new UsernameNotFoundException("Username: " + username + "wasn't found");
return new User(appUser.getUsername(), appUser.getPassword(), grantedAuthorities); }
}
} //---------------------------------------------------------------------------------------------
// If user not found. Throw this exception. /**
throw new UsernameNotFoundException("Username: " + username + " not found"); * A (temporary) class for representing an user.
} *
* @author Julian
//---------------------------------------------------------------------------------------------- *
*/
/** @SuppressWarnings("unused")
* A (temporary) class represent the user saved in the database. private static class AppUser {
* private Integer id;
* @author Julian private String username;
* private String password;
*/ private String role;
@SuppressWarnings("unused")
private static class AppUser { public AppUser(final Integer id, final String username, final String password,
private Integer id; final String role) {
private String username; this.id = id;
private String password; this.username = username;
private String role; this.password = password;
this.role = role;
public AppUser(final Integer id, final String username, final String password, }
final String role) {
this.id = id; public Integer getId() { return id; }
this.username = username; public void setId(final Integer value) { id = value; }
this.password = password;
this.role = role; public String getUsername() { return username; }
} public void setUsername(final String value) { username = value; }
public Integer getId() { return id; } public String getPassword() { return password; }
public void setPassword(final String value) { password = value; }
public void setId(final Integer value) { id = value; }
public String getRole() { return role; }
public String getUsername() { return username; } public void setRole(final String value) { role = value; }
}
public void setUsername(final String value) { username = value; }
//---------------------------------------------------------------------------------------------
public String getPassword() { return password; } }
public void setPassword(final String value) { password = value; }
public String getRole() { return role; }
public void setRole(final String value) { role = value; }
}
//----------------------------------------------------------------------------------------------
}
# Spring properties
spring: spring:
application: application:
name: auth-service # Identify this application name: auth-service # Identifier of this application
# HTTP Server server.port: 4444
server.port: 4444 # HTTP (Tomcat) port
eureka: eureka:
client: client:
serviceUrl: serviceUrl:
defaultZone: http://localhost:8761/eureka/ defaultZone: http://localhost:8761/eureka/ # URL of the eureka server for registration
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment