Authentication
The /src/plugins/auth.ts plugin handles the OAuth2 authentication logic.
-
identifying the authentication server,
-
obtaining the authentication token,
-
refreshing the authentication token.
Plugin registration
import { plugins } from '@cortezaproject/corteza-vue'
// ... other imports ...
// ... other plugin registrations ...
Vue.use(plugins.Auth(), { app: 'compose' })
// ... other plugin registrations ...
Authentication server identification
You can define the authentication server either explicitly or implicitly.
The server is defined explicitly when the window.CortezaAuth parameter is provided.
This is normally provided in the public/config.js file.
The server is defined implicitly when the window.CortezaAuth parameter is not provided.
When the window.CortezaAuth parameter is not provided, the window.CortezaAPI parameter is used.
This is normally provided in the public/config.js file.
-
CortezaAPIendpoint is explicitly set and ends with/api; the/apisuffix is replaced with/authand implicitly used asCortezaAuth. -
CortezaAPIendpoint is explicitly set and does not end with/api; the/authsuffix is appended to theCortezaAPIvalue and implicitly used asCortezaAuth.
| Description | CortezaAPI | CortezaAuth |
|---|---|---|
Setting both endpoints explicitly |
|
|
Setting CortezaAPI only |
|
|
Setting CortezaAPI with auto set |
|
|