-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDevLoginConfigProperties.java
More file actions
35 lines (31 loc) · 1.17 KB
/
Copy pathDevLoginConfigProperties.java
File metadata and controls
35 lines (31 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.digitalsanctuary.spring.user.dev;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import lombok.Data;
/**
* Configuration properties for the dev login feature.
* <p>
* This enables a quick "login as" endpoint for local development, removing the need
* for consuming applications to write boilerplate dev-login controllers.
* </p>
* <p>
* <strong>SECURITY WARNING:</strong> This feature should only be enabled in local/dev
* environments. It allows authentication without a password via a simple GET request.
* </p>
*/
@Data
@Component
@PropertySource("classpath:config/dsspringuserconfig.properties")
@ConfigurationProperties(prefix = "user.dev")
public class DevLoginConfigProperties {
/**
* Whether the dev auto-login feature is enabled. Defaults to false.
* Must be explicitly set to true AND the "local" profile must be active.
*/
private boolean autoLoginEnabled = false;
/**
* The URL to redirect to after a successful dev login. Defaults to "/".
*/
private String loginRedirectUrl = "/";
}