Created
December 10, 2018 19:21
-
-
Save Clancey/9d9a8b8dd83cedf624f58742dff4769f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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