jaguar_jwt 0.1.1 copy "jaguar_jwt: ^0.1.1" to clipboard
jaguar_jwt: ^0.1.1 copied to clipboard

outdatedDart 1 only

JWT interceptor and utilities for Jaguar

Build Status

jaguar_jwt #

JWT authentication interceptor for Jaguar

Usage #

A simple usage example:

library jaguar_jwt.example;

import 'package:dart_jwt/dart_jwt.dart';
import 'package:jaguar_jwt/jaguar_jwt.dart';

void main() {
  //Issuing a JWT token
  JaguarJwtEncoder encoder = new JaguarJwtEncoder(
      new JwaSymmetricKeySignatureContext('dfsdffasdfdgdfgdfg456456456'),
      'teja',
      audience: <String>['admin', 'students']);

  JaguarJwtClaimSet claimSet = new JaguarJwtClaimSet(
      'kleak', encoder.issuer, encoder.audience, {'k': 'v'});
  String encoded = encoder.encodeToken(claimSet);
  print(encoded);

  //Decoding a token
  JaguarJwtDecoder decoder = new JaguarJwtDecoder(
      new JwaSymmetricKeySignatureContext('dfsdffasdfdgdfgdfg456456456'),
      'teja',
      audience: <String>['students']);
  JsonWebToken decoded = decoder.decodeToken(encoded);
  print(decoded.claimSet.toJson());
}
75
likes
0
pub points
96%
popularity

Publisher

unverified uploader

JWT interceptor and utilities for Jaguar

Homepage

License

unknown (license)

Dependencies

auth_header, dart_jwt

More

Packages that depend on jaguar_jwt