Skip to content

Instantly share code, notes, and snippets.

@Clancey
Created December 10, 2018 19:21
Show Gist options
  • Save Clancey/9d9a8b8dd83cedf624f58742dff4769f to your computer and use it in GitHub Desktop.
Save Clancey/9d9a8b8dd83cedf624f58742dff4769f to your computer and use it in GitHub Desktop.
import 'package:simple_auth/simple_auth.dart';
import "package:http/http.dart" as http;
class InstagramApi extends OAuthApi {
InstagramApi(String identifier, String clientId, String clientSecret,
String redirectUrl,
{List<String> scopes,
http.Client client,
Converter converter,
AuthStorage authStorage})
: super(
identifier,
clientId,
clientSecret,
"https://api.instagram.com/oauth/access_token",
"https://api.instagram.com/oauth/authorize",
redirectUrl,
client: client,
scopes: scopes,
converter: converter,
authStorage: authStorage) {
this.scopes = scopes ?? ["basic"];
}
@override
Authenticator getAuthenticator() {
var authenticator = super.getAuthenticator() as WebAuthenticator;
authenticator.useEmbeddedBrowser = true;
return authenticator;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment