I’m working on integrating Binance OAuth authentication into my Flutter application but encountering a configuration issue
const String discoveryURL = 'https://accounts.binance.com/.well-known/openid-configuration';
const String binanceAuthorizationUrl = 'https://accounts.binance.com/oauth/authorize';
const String binanceTokenUrl = 'https://accounts.binance.com/oauth/token';
const String binanceIssuer = 'https://accounts.binance.com';
final List<String> scopeList = [
"user:openId"
];
final AuthorizationTokenResponse? result = await appAuth.authorizeAndExchangeCode(
AuthorizationTokenRequest(
dotenv.env['BINANCE_CLIENT_ID']!,
dotenv.env['BINANCE_REDIRECT_URI']!,
clientSecret: dotenv.env['BINANCE_CLIENT_SECRET']!,
serviceConfiguration: AuthorizationServiceConfiguration(
authorizationEndpoint: binanceAuthorizationUrl,
tokenEndpoint: binanceTokenUrl
),
discoveryUrl: discoveryURL,
scopes: scopeList,
issuer: binanceIssuer,
nonce: 'nonce',
),
);
Here is the error
login error: PlatformException(authorize_and_exchange_code_failed, Failed to authorize: [error: invalid_client, description: null], null, null)
I tried to change client secrets but still get same issue and I expect to get access token
New contributor
Ubaid Ullah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.