Spring-boot-admin: SBA properties are not present in AdminServerProperties.instanceAuth.serviceMap

Created on 13 Dec 2020  路  3Comments  路  Source: codecentric/spring-boot-admin

Here is my configuration properties

server.port=8888
spring.security.user.name=admin
spring.security.user.password=admin

spring.boot.admin.instance-auth.service-map.api-service.user-name=client
spring.boot.admin.instance-auth.service-map.api-service.user-password=client

And my application is set up like this (it is in Kotlin, but I don't think it is important here)

@SpringBootApplication
@EnableAdminServer
class AdminApplication {
    @Autowired
    lateinit var adminServerProperties: AdminServerProperties

    @PostConstruct
    fun init() {
        println(adminServerProperties.instanceAuth.serviceMap)
    }
}

fun main(args: Array<String>) {
    runApplication<AdminApplication>(*args)
}

When I run SBA application the AdminServerProperties.instanceAuth.serviceMap is empty.

bug waiting-for-triage

Most helpful comment

InstanceCredentials has no DefaultConstructor, so Spring cannot load it as a ConfigurationProperties - I will make a PullRequest

All 3 comments

Hi,
I麓ve tried it and ran into the same problem.
Only default-user-name and default-password properties seem to work.

InstanceCredentials has no DefaultConstructor, so Spring cannot load it as a ConfigurationProperties - I will make a PullRequest

I could verify it麓s working now with 2.4.0.
@ccoltx you can close this bug.
Thx!

Was this page helpful?
0 / 5 - 0 ratings