Open Aaqib22 opened 1 year ago
i am unable to run this code
` static Future fetchOutlookCalender() async { var client = OAuth2Client( authorizeUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize', tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token', redirectUri: 'msauth://com.test.app/gYfucgrOlZ3FLWgYctqk1bCxZbo%3D', customUriScheme: 'com.test.app');
var token = await client.getTokenWithAuthCodeFlow( clientId: 'f865f294-3647-43d7-bc6e-f726f06nnno56be', scopes: ['openid profile offline_access user.read calendars.read']); log('accesstoken:' '${token.accessToken}');
}`
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument (callbackUrlScheme): must be a valid URL scheme: "com.test.app"
Hi @Aaqib22, the customUriScheme must correspond to the scheme of the redirectUri, in your case "msauth". Hope it helps!
i am unable to run this code
` static Future fetchOutlookCalender() async { var client = OAuth2Client( authorizeUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize', tokenUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/token', redirectUri: 'msauth://com.test.app/gYfucgrOlZ3FLWgYctqk1bCxZbo%3D', customUriScheme: 'com.test.app');
}`
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument (callbackUrlScheme): must be a valid URL scheme: "com.test.app"