Even if client id is correct its giving invalid client_id message in authorize callback


I am using this library to do OAuth with Strava. It works fine till redirecting a user to the authentication page of Strava but the issue comes once the user approves the application.
In error, it says that client_id is invalid but actually it isn’t because 1) I double checked 2) If that’s the case then it should give an error when opening authentication page but it didn’t.

I don’t know what is the best way to debug the error. I tried setting up debugger in Xcode but it didn’t work as I was not getting a clear picture through debugging points.

I am pasting my code below:


import { authorize, refresh, revoke } from 'react-native-app-auth';

config = {
    issuer: 'https://www.strava.com/oauth/mobile/authorize',
    clientId: '***',
    clientSecret: '*********',
    redirectUrl: 'myapp://myapp.com/'
    serviceConfiguration: {
      authorizationEndpoint: 'https://www.strava.com/oauth/mobile/authorize',
      tokenEndpoint: 'https://www.strava.com/oauth/token',
      revocationEndpoint: 'https://www.strava.com/oauth/deauthorize'
    additionalParameters: {
      response_type: 'code',
      approval_prompt: 'force',
      grant_type: 'authorization_code'
    scopes: ['activity:read']

try {
    const authState = await authorize(this.config);
} catch (error) {

Info.plist (iOS)



#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge

  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
 return [self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url];


I don’t know what is the issue. Is it something related to code or Am I passing data wrong?

Source: React natvie