title: How do I wire up spring oauth using spring eureka?
body: <p>I have created a Single Page Application using the Spring Tutorial for making one with AngularJS and OAuth and such found here:
  <a href="https://spring.io/guides/tutorials/spring-security-and-angular-js/#_multiple_ui_applications_and_a_gateway_single_page_application_with_spring_and_angular_js_part_vi" rel="nofollow">https://spring.io/guides/tutorials/spring-security-and-angular-js/#_multiple_ui_applications_and_a_gateway_single_page_application_with_spring_and_angular_js_part_vi</a></p>
  
  <p>This is the application.yml files for the SPA application:</p>
  
  <pre><code>security:
    user:
      password: none
    oauth2:
      client:
        accessTokenUri: localhost:7777/uaa/oauth/token
        userAuthorizationUri: localhost:7777/uaa/oauth/authorize
        clientId: acme
        clientSecret: acmesecret
      resource:
        user-info-uri: localhost:7777/uaa/user
  
  
  zuul:
    routes:
      resource:
        path: /resource/**
        url: localhost:9000/resource
      user:
        path: /user/**
        url: localhost:7777/uaa/user
  
  eureka:
    client:
      serviceUrl:
        defaultZone: ${vcap.services.eureka-service.credentials.uri:127.0.0.1:8761}/eureka/
  
  ---
  spring:
    profiles: cloud
  eureka:
    instance:
      hostname: ${APPLICATION_DOMAIN}
      nonSecurePort: 80
  </code></pre>
  
  <p>I want to know how I would change the zuul routes and the user-info-uri so that I don't have to specify the urls and all this can be done by using the service-id. I looked at the tutorial for using eureka here: </p>
  
  <p><a href="https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka" rel="nofollow">https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka</a></p>
  
  <p>but I don't quite understand how I can achieve my goal without adding all the java to my code, because the basic eureka server already seems to register all my services. </p>