V2 & MAPS Setup in Development
Introduction
This pages describe how to setup MAPS and V2 systems such that MAPS is used for authentication management for the V2 system.
Overview of procedure:
- Setup MAPS and V2 systems
- Bootstrap users on the MAPS and V2 systems
- Invite a new V2 user, who confirms login and logs in via MAPS
Setup Procedure
Prerequisites
Using webbrick in the rails development environment
- Base directories for MAPS and V2, with the appropriate branches, are checked out
- Basic MAPS and V2 settings are configured correctly
Procedure
This procedure assumes the following:
MAPS will be accessible at: localhost:4000, git checkout at directory ~/rails/maps
V2 will be accessible at: localhost:4010, git checkout at directory ~/rails/v2p0
Steps
- Configure MAPS and V2
See V2MapsConfiguration for details
- Setup and start MAPS, running on port 4000:
cd ~/rails/maps bundle install bundle exec rake db:drop db:create db:migrate rails server -p 4000
- Setup and start V2, running on port 4010:
cd ~/rails/maps bundle install bundle exec rake db:drop db:create db:migrate db:seed_fu_without_access_control rails server -p 4010
- Clear all localhost:4000 and localhost:4010 cookies in the browser
- Register a new admin user in MAPS
Open maps: http://localhost:4000
Click menu: Login
Click link in form: Register
- Enter form information:
First name: your first name
Last name: you last name
Company: SoftXS GmbH
Email: maps@softxs.ch -- Ideally use an email address that works. The address maps@softxs.ch works
Password: 12345678 -- Passwords must be at least 8 characters long
Password confirmation: 12345678
Press Register
- MAPS will now attempt to send an email to the email address. The email will contain a URL for confirming the address
- To get the confirmation URL do one of the following:
- Receive the email with the link
- Look in ~/rails/maps/log/development.log for a copy of it.
Get the confirmation_token from the database with:
select first_name, last_name, authentication_token from users;
- The confirmation URL should be constructed to look like the following (where the final value is the authentication_token from the database):
http://localhost:4000/users/confirmation?confirmation_token=3xoqsqQKNi5sAsoarFpb
- Open the confirmation link, you will be presented with screen with the following message in blue, at the top:
Your account was successfully confirmed. You are now signed in.
Grant the root role to the admin user, using the rails console:
rails console > u = User.find_by_email('maps@softxs.ch') > u.add_role :root > y u.roles # Verify the role is really assigned, should see a login role and a root role
- Verify the root role is working.
Click on the SoftXS (home) link in the upper left-hand of the navbar
The home screen should be displayed and an Admin menu item should appear on the far right
Click on menu Admin --> Single Sign On --> Clients
- An empty clients list should be displayed
Verify there is a button + Create New Client
- Register the V2 application instance in MAPS
Click on menu Admin --> Single Sign On --> Clients
Click + Create New Client button
- Enter form data:
Name: v2p0 on port 4010 -- Can be anything
App: V2P0_Dev -- Must match V2 Settings.SXS.SSO.AppID
- App secret: -- Choose one the the following:
Accept the random key value, and set V2 Settings.SXS.SSO.AppSecret to match
Insert the V2 Settings.SXS.SSO.AppSecret value
Press Save
- Login to V2, using a local identity, and invite a new user
Select one of the following email addresses to use, which are all configured as local identities in V2 and have the password 12345678
- Give the selected local_identity user the root role, using the rails console:
> u = User.find_by_email('ah@softxs.ch') # Use the selected email address > u.add_role :root > y u.roles # Verify the role is really assigned, should see a login role and a root role
Open V2: http://localhost:4010/local_login and login:
The Local Login Page should be displayed
Login using the selected email address and the password 12345678
Verify the Login menu changes it title to the email address and now has sub-entries for Logout and App. Profile
Verify that there is also an Admin menu to the left of the email menu
- Invite a new user.
You should use the User Invitation and not the Admin Invitation (which is accessed via menu Admin --> Invitations)
Click on email menu --> App. Profile
- The user's application profile will be displayed
Click on the Invite Someone link in Quick Links box
A New Invitation form will be displayed. Enter form data:
Email address: Your email address -- Do not use one of the local identity email addresses. Try and use a valid email address
First name: Your first name
Last name: Your last name
Company name: SoftXS GmbH
Subject: Test subject
Message: Test message
Click button Save & Send button
- V2 will now attempt to send an email to the email address. The email will contain a URL for confirming the new user and setting a password
- To get the confirmation URL do one of the following:
- Receive the email with the link
- Look in ~/rails/v2p0/log/development.log for a copy of it.
- Get the confirmation_token from the database with:
select first_name, last_name, authentication_token from users;
- The URL should be constructed to look like the following (where the final value is the authentication_token from the database):
Open the confirmation link, you should be redirected to MAPS (e.g. localhost:4000) and a user profile form should be displayed
If you get a too many redirects error then one of the following could be wrong:
- You forgot to clear cookies at the start
- You used one of the local identity user's email address for the invitation
In the browsers URL field you should see a very long URL which contains the CGI parameter return_to=http... (basically the V2 home page)
- On the right hand side the form should be filled in with the user's name, etc.
- Enter a password and confirmation password
Click button Save
- You should be redirected to V2 and be logged in