spring-cloud-samples / configserver

371 stars 394 forks source link

Cannot authenticate when running in Pivotal Web Services #4

Closed jbcpollak closed 9 years ago

jbcpollak commented 9 years ago

I have an unmodified version of configserver running on PWS. If I am reading the config in application.yml correctly:


---
spring:
  profiles: cloud
eureka:
  instance:
    hostname: ${PREFIX:}${spring.application.name}.${application.domain:cfapps.io}
    nonSecurePort: 80
# no JCE in PWS
security:
  user:
    password: password

When running in PWS the password should be password.

I'm not completely sure this is necessary, but I set the environment variable SPRING_PROFILES_DEFAULT=cloud in my PWS app config.

When I run curl, I get this error:

~/s/configserver ❯❯❯ curl https://user:password@myconfigserver.cfapps.io/application/cloud
{"timestamp":1417193631970,"status":401,"error":"Unauthorized","message":"Bad credentials","path":"/application/cloud"}% 
dsyer commented 9 years ago

You need SPRING_PROFILES_ACTIVE=cloud I think. That's how we run in the samples.

jbcpollak commented 9 years ago

Hum, I would have thought SPRING_PROFILES_DEFAULT=cloud would have the same effect that, but I'll give it a shot.