tokkit
tokkit
is a simple(even simplistic) token toolkit for OAUTH2 authorization
targetting service to service authorization.
Adding tokkit to your project
tokkit is available on crates.io.
Documentation
The documentation is available online.
Features
Verify Access Tokens
tokkit
contains a module token_info
for protected resources to verify access tokens.
use *;
use *;
let builder = google_v3;
let service = builder.build.unwrap;
let token = new;
let tokeninfo = service.introspect.unwrap;
Managing Tokens
tokkit
can manage and automatically update your access tokens if you
are a client and want to access a resource owners resources.
Currently tokkit
only supports the
Resource Owner Password Credentials Grant
which should only be used if the resource owner can really trust the client.
use *;
use *;
use *;
use *;
let credentials_provider = with_default_parsers_from_env
.unwrap;
let token_provider =
ResourceOwnerPasswordCredentialsGrantProvider
from_env_with_credentials_provider
.unwrap;
let token_group =
single_token
.build
.unwrap;
let token_source = start.unwrap;
let access_token = token_source.get_access_token.unwrap;
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