oauth2restclient 0.0.1 copy "oauth2restclient: ^0.0.1" to clipboard
oauth2restclient: ^0.0.1 copied to clipboard

OAuth2 login and rest client

OAuth2RestClient A Dart/Flutter package that simplifies OAuth2 authentication and REST API interactions with automatic token management.

Features #

OAuth2 Authentication: Easy implementation of OAuth2 login flows

Account Management: Securely store and load user accounts and tokens

Automatic Token Handling: Transparently manages access tokens in request headers

Token Refresh: Automatically refreshes expired tokens when needed

Service Integration: Simplifies integration with REST APIs like Google Drive

Usage #

	final account = OAuth2Account();
		
	var google = Google
	(
		redirectUri: "com.googleusercontent.apps.95012368401-j0gcpfork6j38q3p8sg37admdo086gbs:/oauth2redirect",
		scopes: ['https://www.googleapis.com/auth/drive', "https://www.googleapis.com/auth/photoslibrary", "openid", "email"],
		clientId: dotenv.env["MOBILE_CLIENT_ID"]!
	);

	if (Platform.isMacOS)
	{
		google = Google
		(
			redirectUri: "http://localhost:8713/pobpob",
			scopes: ['https://www.googleapis.com/auth/drive', "https://www.googleapis.com/auth/photoslibrary", "openid", "email"],
			clientId: dotenv.env["DESKTOP_CLIENT_ID"]!,
			clientSecret:dotenv.env["DESKTOP_CLIENT_SECRET"]!,
		);
	}

	account.addProvider("google", google);


    var token = await account.newLogin("google");

	//or

	token = await account.loadAccount("google", "userName")

	var client = await account.createClient(token);

1
likes
0
points
95
downloads

Publisher

unverified uploader

Weekly Downloads

OAuth2 login and rest client

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

app_links, flutter, flutter_secure_storage, http, shared_preferences, url_launcher

More

Packages that depend on oauth2restclient