Skip to content
/ dart-jwt-example Public template

Example project - how to implement JWT authentication in Dart

License

Notifications You must be signed in to change notification settings

kenreilly/dart-jwt-example

Repository files navigation

dart-jwt-example

An example project demonstrating how to implement basic JWT authentication in Dart


Getting Started

  • Install Dart, available here
  • Clone this repository
  • cd into the project directory
  • run pub get to install packages

Testing

  • start the server with $ dart bin/server.dart
  • try an API call with $ curl localhost:3000/hello (should be rejected)
  • authenticate with $ curl localhost:3000/auth -d '{"username":"test", "password":"insecure"}' (should return a JWT, copy this)
  • retry API call with $ curl localhost:3000/hello -H "Authorization: Bearer YOUR_TOKEN" (should return OK)

Docs

For more information, see this tutorial.


Contributions

Suggestions, ideas, comments, and pull requests are welcome. Thanks!

About

Example project - how to implement JWT authentication in Dart

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published