@adra-network/authentication-module
v0.0.5
Published
Authentication Module
Downloads
12
Readme
@adra-network/authentication-module
ADRA Network Authentication Module for Nuxt 3 applications.
Quick Setup
- Add
@adra-network/authentication-module
dependency to your Nuxt 3 project
# Using npm
npm install @adra-network/authentication-module
- Add
@adra-network/authentication-module
to themodules
section ofnuxt.config.ts
// nuxt.config.ts
{
modules: [
///...
'@adra-network/authentication-module',
],
}
- Configure if needed via
nuxt.config.ts
// nuxt.config.ts
{
adraAuthentication: {
/**
* Base URL of the authentication service
* @default process.env.AD_AUTHENTICATION_EXTERNAL_BASE_URL
*/
url: string,
/**
* Realm name of the authentication service
* @default process.env.AD_AUTHENTICATION_DEFAULT_REALM || 'network'
*/
realm: string,
/**
* Client ID of the frontend application
* @default process.env.AD_AUTHENTICATION_CLIENT_ID || 'adra-frontend'
*/
clientId: string,
}
}
- Use it via the composable
<script setup>
const {(authenticated, user, token, idToken, login, logout)} = useAuth();
</script>