Expand description
§tokkit
tokkit
is a simple(even simplistic) token toolkit for OAUTH2 token
introspection
§Adding tokkit to your project
tokkit is available on crates.io.
§Documentation
The documentation is available online.
§Features
async
: Adds areqwest
based async client. See alsoTokenInfoServiceClientBuilder
metrix
: Add support for the metrix crate(async client only) See alsoTokenInfoServiceClientBuilder
§Verify Access Tokens
tokkit
contains a module token_info
for protected resources to verify
access tokens.
use tokkit::client::*;
use tokkit::*;
let builder = TokenInfoServiceClientBuilder::google_v3();
let service = builder.build().unwrap();
let token = AccessToken::new("<token>");
let tokeninfo = service.introspect(&token).unwrap();
§Recent changes
- 0.17.0
- Futures 0.3 compatibility
- Replaced hyper with reqwest
- Removed a bunch of obsolete APIs
- 0.15.3
- Use reqwest 0.9
- 0.15.2
- Async Client has default https connector
- 0.15.1
- Async Client can be created with a given Executor
- 0.15.0
- updated metrix
- 0.14.0
- Add a client that takes an HttpClient as a parameter
- 0.13.0
- parser does not need the http client in an Arc
§License
tokkit is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
Copyright (c) 2017 Christian Douven Token verification for protected resources on resource servers.
See OAuth 2.0 Token Introspection and Roles
Modules§
- client
- Different implementations
- metrics
- parsers
- Various parsers for the responses of a token info service.
- token_
manager - Managing
AccessToken
s.
Structs§
- Access
Token - An access token
- Initialization
Error - An error to be returned if the initialization of a component or else fails.
- NotAuthorized
- There is no authorization for the requested resource
- Scope
- An access token scope
- Token
Info - Information on an
AccessToken
returned by aTokenInfoService
. - Token
Info Error - UserId
- An id that uniquely identifies the owner of a protected resource
Enums§
Traits§
- Token
Info Service - Gives a
TokenInfo
for anAccessToken
.
Type Aliases§
- Initialization
Result - A
Result
where the failure is always anInitializationError
- Token
Info Result