<AsgardeoSignIn />
<AsgardeoSignIn> renders an embedded sign-in form of the WSO2 Identity Platform Nuxt SDK (@asgardeo/nuxt), so users sign in inside your app instead of on the WSO2 Identity Platform sign-in page.
Underneath, the component uses the App-native Authentication API to run the sign-in flow. Enable app-native authentication for your application in the WSO2 Identity Platform Console before you use it.
Overview
<AsgardeoSignIn> renders the steps of the sign-in flow that you configured for your application. Each step goes through the module's POST /api/auth/signin route, so your client secret stays on the server. When the flow completes, the server exchanges the authorization code for tokens, sets the session cookie, and the component:
- Updates the authentication state, so
useAsgardeo().isSignedInbecomestruewithout a page reload. - Emits
success. - Navigates to
afterSignInUrl.
Usage
The component is auto-registered, so you don't need to import it. Create a sign-in page that renders it:
<template>
<AsgardeoSignIn />
</template>
Then point <AsgardeoSignInButton> at that page:
NUXT_PUBLIC_ASGARDEO_SIGN_IN_URL="/sign-in"
Handle events
<script setup lang="ts">
const onError = (error: Error) => {
console.error('Sign-in failed:', error);
};
</script>
<template>
<AsgardeoSignIn variant="elevated" size="large" @error="onError" />
</template>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | '' | CSS class for the root element. |
size | 'small' | 'medium' | 'large' | 'medium' | Size of the form and its controls. |
variant | 'elevated' | 'outlined' | 'flat' | 'outlined' | Card style of the form. |
Events
| Event | Payload | Description |
|---|---|---|
success | Record<string, any> | Emitted when the sign-in flow completes. |
error | Error | Emitted when a step of the sign-in flow fails. |
Was this page helpful?