A Quasar extension for validate into UPC SSO authentication server and obtain a JWT with user profile from own API
- Both axios as well as Vuex are required for this extension.
Require a server [api-cas-jwt] running for validate and return jwt
Run extension
quasar ext add sso-upc
The installation requests the routes to be used to communicate with the backend and adds them to the .env file so that they can be modified later
The authentication logic is performed inside a Vuex store. this.$auth
provides
a helper to access the functionality in the store and this.$api
provides a instance
for secure api calls.
Function | Functionality |
---|---|
$auth.logout | Logs out the current user and redirect to login page. |
$auth.isLoggedIn | Returns a boolean to determine if the user is logged in. |
$auth.getProfile | Get the complete profile of the auth Bearer JWT. |
$auth.userData | Get the user data send by optional own API profile. |
$auth.isAdmin | Returns a boolean to determine if the user has admin role. |
$auth.personName | Get the name of logged user. |
$auth.personCompleteName | Get the complete name of logged user. |
$auth.personEmail | Get the email of logged user. |
$auth.userPhoto | Get the photo of logged user. |
$auth.hasRoles(roles) | Returns a boolean to determine if the user has any of roles . |
quasar ext remove sso-upc
The profile data depends on the parameters returned by the API-CAS-JWT server