oauth_dio 0.2.4-beta1 oauth_dio: ^0.2.4-beta1 copied to clipboard
A customizable oauth client with token storage and interceptors for dio
import 'package:oauth_dio/oauth_dio.dart';
void main() {
final oauth = OAuth(
clientId: 'foo',
clientSecret: 'bar',
tokenUrl: 'https://example.com/oauth/token');
oauth
.requestToken(PasswordGrant(username: 'foo', password: 'bar'))
.then((token) {
print('AccessToken: ${token.accessToken}');
print('RefreshToken: ${token.refreshToken}');
print('Expiration: ${token.expiration}');
});
}