User Account Management
User Account Management
Objective
To provide the capability of managing accounts in the VAPP system.
Success metrics
Goal Metric
Assumptions
Requirements
Jira
System Requirement
Issue
Online authentication
The VAPP system supports “Login with Gmail”. However, users cannot
sign up by themself, only users created by the User account management
feature can sign in to the system.
This feature also requires developing the Sign in and Sign out procedures References:
MOBILE for the system.
1 https
& CMS
The VAPP system can have more authentication options for users in the https
future.
Wireframe:
https://www.figma.com/file/slJKrmQUWP2njr0GMCESJw/Virbac-
App?node-id=29%3A11218
Auto authentication
To improve user-experiences, once logging in successfully, if the
credentials don’t change or users haven’t signed out, then users don’t need
to provide the id and password next time access to the system.
When the credentials changes or the user has signed out, the user has to
enter the credentials again.
For WP1, we will implement a simple security layer:
An access token is valid for 720 hours
We will store the user’s credentials to local
MOBILE
2 When launching the app, if it’s online, the app will log in again to
& CMS
expand the access token
o If auto-login fails (token is expired), the app will log out
For future versions, there are several tips to increase the security level of
the system when auto-authenticating such as:
We won’t store the user’s credentials, but store refresh tokens
We only provide shorter-lived access tokens
We use refresh tokens (or refresh token rotation) to expand tokens
every time doing auto authentication
When signing out, we revoke all refresh tokens
Offline authentication
In offline mode, the application do the authentication based on stored id
tokens.
References:
If the stored id tokens are invalid or expired, the application won’t allow
3 MOBILE https
users to use the application.
secur
To renew the id tokens, users can do authentication again when the
application is in online mode.
For the WP1, an id token is valid for 24 hours.
Roles-based access control
The VAPP system uses a roles-based access control strategy to control the
permissions of a user in the system. In which:
A user can be assigned to 1 or many roles. A user’s roles list is
mutable.
A role contains 1 or many permissions. A permissions list of a role
is mutable.
Based on the gained permissions, a user can access and use features
of the CMS and the mobile application.
Based on the gained permissions, an API call can be processed in
MOBILE the backends.
4
& CMS The permissions can be valid or invalid within a condition. For
example: if the customers are synced to Virbac database, only
admins can modify the customers. However, if the customers aren’t
synced, sale reps can modify their own customers.
To verify permissions of a user, the CMS and the mobile application will
use the Application authorization feature.
To verify permissions of an API request, the backends will use the API
authorization feature.
To update roles and permissions, the system will use the Roles and
permissions management feature.
Application authorization
When doing online authentication, the applications will specify the
corresponding claims to able to get corresponding permissions of a user
from returning id tokens.
Each application should have an access permission which defines whether References:
a user can sign in to the application. Role-
MOBILE
5 For example: access:mobile or access:cms. contr
& CMS
Based on the permissions (or rights) described in each feature, users can Perm
see the corresponding UI/UX. user-
For example: Without a create:customer permission, users
cannot see the “Customer creation” option in the applications.
Specific roles and permissions will be defined in other specific
requirements/features.
API authorization
When doing online authentication, the applications will specify the
corresponding claims to able to get corresponding permissions of a user
from returning access tokens.
APIs which access to specific resources will require corresponding
permissions. For example: create:virbacProduct,
MOBILE
6 edit:virbacProduct, delete:virbacProduct, view:virbacProduct,
& CMS
etc.
Only applications that link to the APIs can gain the permissions and use
the APIs.
To access the APIs using third-party tool such as Postman, we can do the
authentication from our applications to get access tokens, then use the
access tokens for these tools.
Admin and Sale rep roles
MOBILE For WP1, there are two basic roles who are Admin and Sale rep.
7
& CMS Admin can access the CMS system.
Sale rep can access the Mobile system.
Open Questions
Questio
Answer Date Answered
n
Out of Scope