Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-816

TODO App: Fix user registration

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 1.0.0.M8
    • 1.0.0.M8
    • examples
    • None

    Description

      Currently the user registration in the TODO app is not working. The reason for this is that there is a mismatch between the endpoint path that the client JS is using, 'enroll', and the path on the server side, 'register'.

      One option is to change client side and override the default path:
      client/src/main/webapp/js/app.js

       // Instantiate our authenticator
          var restAuth = AeroGear.Auth({
              name: "auth",
              settings: {
                  agAuth: true,
                  baseURL: "/todo-server/",
                  endpoints: {enroll: "auth/register"}
              }
          }).modules.auth;
      

      Another option would be to modify the server side @Path from 'register' to 'enroll':
      org.aerogear.todo.server.security.rest.AuthenticationEndpoint.java

      @POST
      @Path("/enroll")
      @Produces(MediaType.APPLICATION_JSON)
      public Response register(final AeroGearUser user) {
      
          //TODO it should be done by admin screen
          idm.grant(user.getRole()).to(user);
      
          return authenticationManager.login(user.getUsername(), user.getPassword());
      
      }
      

      The dev-list thread (see 'Forum Reference') will decide which change should be made. It was decided to change the resources path to 'enroll' in aerogear-security but in the TODO App let the client override this setting.

      Attachments

        Activity

          People

            dbeveniu Daniel Bevenius (Inactive)
            dbeveniu Daniel Bevenius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: