We make use of the Security library to ensure the safe functioning and authorization management of our application.

This library is mainly responsible for validating the user session and granting access permissions to each of our app views and functionalities.

It also plays a huge role in the Ocean integration process.

Features and code composition

Explore the primary components that make up Oasis Security and its relation to the Ocean integration.

Feature and composition

API reference

Follow the link below to learn more about Oasis Security API reference.

How to run locally Oasis Security

Learn how to run the Oasis Security locally to develop and to decode/encode payloads.

Run Oasis Security locally

Oasis Security helpers

Oasis Security helpers are reusable classes that provide common functionalities within our app. They simplify development tasks, promote code consistency, and improve maintainability.

Oasis Helpers

Getting started with @oasis/security

In this section, we'll learn how to install and use Oasis Security in a frontend app and library/component.

Installation

npm i @oasis/security

# or upgrade to the latest version

npm update @oasis/security

Setup

⚠️ The setup is different for apps and libraries/components.

Setup for frontend apps

...
import OasisSecurity, { OasisRender } from '@oasis/security';

import store from '@/store';

// Initialize the app with the following options
Vue.use(OasisSecurity, { store, initialize: true });

const vueLifeCycles = {
	...
	appOptions: {
		// Modify the render as follows:
    render(h) {
      return OasisRender(h, App, {
        props: {
          name: this.name,
          mountParcel: this.mountParcel,
          singleSpa: this.singleSpa,
        },
      });
    },
		...
}

Usage in router

Add this to your router index.js