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.
-
CortezaAPI
endpoint is explicitly set and ends with/api
; the/api
suffix is replaced with/auth
and implicitly used asCortezaAuth
. -
CortezaAPI
endpoint is explicitly set and does not end with/api
; the/auth
suffix is appended to theCortezaAPI
value and implicitly used asCortezaAuth
.
Description | CortezaAPI | CortezaAuth |
---|---|---|
Setting both endpoints explicitly |
|
|
Setting CortezaAPI only |
|
|
Setting CortezaAPI with auto set |
|
|