Anonymous access GraphQL API from React Native Android APP

I am accessing my GraphQL API built on realm outside Mongo platform. Anonymous authentication provider is enabled in MongoDB.

I used realm in react native to login to app to get anonymous token needed to pass in authorisation headers of axios post request.

                const credentials = Realm.Credentials.anonymous();

                const app = new Realm.App(appConfig);

                let user = await app.logIn(credentials);

                let accessToken = user.accessToken;

const authAxios = axios.create({

                  url: apiUrl,

                  method: 'post',

                   headers : { Authorization : 'Bearer ${accessToken}'},



Realm app login is success. However the axios request fails with

I am getting below error in my mongodb logs - token contains an invalid number of segments

getting 401 in React Native app.

can someone guide me to set the correct anonymous access token in axios headers.