Forum Discussion

Mansi12398's avatar
Mansi12398
Copper Contributor
Jul 07, 2022

Microsoft graph login not working in android

We are using https://graph.microsoft.com/v1.0/me for Microsoft login in the Android app.

but got com.android.volley.AuthFailureError error.

AUTH CONFIG FILE:

 

{
  "client_id": "...",
  "authorization_user_agent": "DEFAULT",
  "redirect_uri": "msauth://....",
  "account_mode" : "MULTIPLE",
  "broker_redirect_uri_registered": false,
  "authorities" : [
    {
      "type": "AAD",
      "authority_url": "https://login.microsoftonline.com/common"
    }
  ]
}
  MSGraphRequestWrapper.callGraphAPIUsingVolley(
                this,
                accessToken,
                "https://graph.microsoft.com/v1.0/me",
                new Response.Listener<JSONObject>() {
                    @Override
                    public void onResponse(JSONObject response) {
                        /* Successfully called graph, process data and send to UI */

                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        error.printStackTrace();
                        //Here got error com.android.volley.AuthFailureError
                    }
                });

 

 

Although it's working with our other clientid, only creates problem in production clientid.

ERROR:

Spoiler
com.android.volley.AuthFailureError
    at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:189)
    at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)
    at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)
    at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
    at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
Spoiler
Volley: [343742] NetworkUtility.shouldRetryException: Unexpected response code 403 for
https://graph.microsoft.com/v1.0/me

Can anyone please suggest why it's happening?

No RepliesBe the first to reply

Resources