iOS Delegated User APIs
External authentication APIs for third-party identity providers. Use when your app manages its own user authentication and you want to integrate with Vipaso without using Vipaso's identity system. Access these APIs through vipaso.user.delegated
.
Delegated Authentication
Establish Authentication
Connect your existing authentication system with Vipaso. Call this method after your user logs in through your own authentication system:
do {
try await vipaso.user.delegated.establishAuthentication(
userIdentifier: "your-user-id-123",
connect: { jwk in
// 1. Send the JWK to your backend endpoint
// 2. Your backend should process the JWK and return an encrypted token
// 3. Return that token here
// Example implementation:
return try await yourBackendService.processJWK(jwk)
}
)
// Authentication established successfully
// User can now access Vipaso features
} catch {
// Handle authentication error
print("Delegated authentication failed: \(error.localizedDescription)")
}
Logout
Log out the current delegated user:
vipaso.user.delegated.logout()
// Authentication state change will be sent via delegate
Notes
- Call Timing: Call
establishAuthentication()
after your user logs in and on each app start - Backend Integration: Your backend must process the JWK and return an encrypted token