spring-projects/spring-credhub

Mis-configured client ID causes NPE

scottfrederick opened this issue · 1 comments

If the OAuth2 client registration configured in spring.credhub.oauth2.registration-id does not match a client registration in spring.security.oauth2.client.registration, Spring CredHub will throw an NPE on initialization of the RestTemplate.

For example:

spring:
  credhub:
    url: [CredHub server URL]
    oauth2:
      # this does not match the credhub-client registration below
      registration-id: bad-credhub-client 
  security:
    oauth2:
      client:
        registration:
          credhub-client:
            provider: uaa
            client-id: [OAuth2 client ID]
            client-secret: [OAuth2 client secret]
            authorization-grant-type: client_credentials
        provider:
          uaa:
            token-uri: [UAA token server endpoint]