OASIS Avatar SSO SDK - Angular
Complete Angular integration for OASIS Avatar Single Sign-On authentication.
Installation
npm install @oasis/avatar-sso-angularQuick Start
1. Import the Module
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { OasisAvatarSSOModule } from '@oasis/avatar-sso-angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
OasisAvatarSSOModule.forRoot({
apiUrl: 'https://api.oasis.network',
provider: 'Auto'
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }2. Use in Components
3. Use Auth Guard
Features
✨ Full Angular Integration - Built specifically for Angular 15+ 🔐 Type-Safe - Complete TypeScript support 🚀 Reactive - RxJS observables for auth state 🛡️ Route Guards - Built-in authentication guards 🎨 Customizable - Flexible configuration options
API Reference
OasisAvatarSSOService
Methods
login(username: string, password: string, provider?: string): Promise<AuthResult>logout(): Promise<void>isAuthenticated(): Promise<boolean>getCurrentUser(): Promise<User | null>refreshToken(): Promise<void>
Observables
authState$: Observable<AuthState>- Current authentication stateuser$: Observable<User | null>- Current user data
License
MIT © OASIS Team
Last updated