sa_flutter 0.0.2 sa_flutter: ^0.0.2 copied to clipboard
Flutter library for @QBitArtifact's Superadmin
sa_flutter #
Flutter library for @QBitArtifact's Superadmin. It handles Auth and some other stuff for you.
NOTICE: Library under development, use at own risk
Getting Started #
Add dependency to pubspec.yaml
: #
dependencies:
sa_flutter: <latest_version>
Usage #
Sign in to SuperAdmin, and get a token: #
- Instantiate SaAuthService with proper config
final auth = SaAuthService(
'https://api.caste.qbitartifacts.com',
realm: '<your_realm>',
);
- Now we can use the service:
var tokenData = await auth.signIn('username', 'password');
var payload = SaAuthService.decodeToken(tokenData['token']);
- Now we can use this token to authenticate against SuperAdmin itself or other APIs that integrate SA.
Header will have this format:
'Authorization': 'Bearer <token>'