Getting 403 disallowed_useragent on Azure B2C + Ionic Capacitor InAppBrowser google login
I solve it by adding the overrideUserAgent
to the capacitor.config.json like this
"cordova": {
"preferences": {
"OverrideUserAgent": "Mozilla/5.0 Google"
}
},
This object was added to the root of the file.
The problem is that Cordova preferences are added to capacitor preferences when we run cap init
command, After that to add Cordova preferences we should use Cordova object inside capacitor.config.json as I did above.
https://capacitorjs.com/docs/cordova/migrating-from-cordova-to-capacitor#cordova-plugin-preferences
403 Error: disallowed_useragent
After Following Google drive API Quick start, Add these 3 lines of code in AppDelegate.m didFinishLaunchingWithOptions as Shown below.. then it works fine ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString *userAgent = @"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.23 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602";
// set default user agent
NSDictionary *dictionary = [[NSDictionary alloc]initWithObjectsAndKeys:userAgent,@"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:(dictionary)];
return YES;
}
Related Topics
How to Draw on an Image in Swift
Phonegap on iOS with Absolute Path Urls for Assets
Ios: Helpfulness of Didreceivememorywarning:
How to Share My Current Location to Uiactivityviewcontroller
Instagram API Prevents Redirection to iOS App Upon Successful Login with 400 Bad Request Error
Using the C API for Imagemagick (On Iphone) to Convert to Monochrome
Why Does Unexpected Non-Void Return Value in Void Function Happen
How to Connect Iboutlet from Storyboard to Uiview Subclass
Get the Callers Phone Number from an Incoming Call on Iphone
How to Get the Modulus or Exponent from a Seckeyref Object in Swift
Setting Up a Plist to Store Application Data (Not Settings) for an iPhone Game
Following in App Purchase, App Crashing on Startup. Productidentifier=Nil
Swift Dynamic Table Cell Height
How to Create an Nsdecimal Without Using Nsnumber and Creating Autoreleased Objects
Dynamic Collectionviewcell in Tableviewcell Swift
Switching from Xcode3 to Xcode4 - Can't Load Programs Onto Older Ipod Touch