Request failed with status HTTP/1.1 401 Unauthorized

498 views
Skip to first unread message

Kapil Dalwani

unread,
May 21, 2012, 2:34:05 AM5/21/12
to rdio...@googlegroups.com
Hi al,

I am trying to run the sample android rdio app on nexus one. But, somehow I am not able to load my collection. 
I am able to go pass the oauth screen etc and the rdio app returns with the user state as UNLIMITED but I am unable to load the collection. 
I am not sure why it is saying that the secret and key are null. 

Can anyone help me debug this?

Thanks
Kapil

05-20 23:24:51.711 I/RdioAPI (14922): Finished app connection

05-20 23:24:51.711 I/RdioAPI (14922): Notifying token ready.
05-20 23:24:51.711 I/RdioAPI (14922): Rdio API ready. Time:2086
05-20 23:24:51.711 I/RdioAPI (14922): Rdio API initialized
05-20 23:24:51.711 I/RdioAPIExample2(14922): User state is UNLIMITED fullstream true
05-20 23:24:51.711 I/RdioAPIExample2(14922): Getting current user
05-20 23:24:51.801 I/ActivityManager(   92): Starting: Intent { act=com.rdio.android.ui.AUTHORISE_THIRD_PARTY_APP cmp=com.rdio.android.ui/rdio.activities.OAuthAuthorizationActivity (has extras) } from pid 14922
05-20 23:24:51.831 I/ActivityManager(   92): No longer want com.xtralogic.android.logcollector (pid 14642): hidden #16
05-20 23:24:51.971 D/dalvikvm(14601): GC_EXTERNAL_ALLOC freed 1016K, 52% free 4004K/8263K, external 5418K/5618K, paused 58ms
05-20 23:24:52.131 I/RDIO    (14601): RemoteControlHelper: Registering media buttons
05-20 23:24:52.131 I/AudioService(   92):   Remote Control   registerMediaButtonEventReceiver() for ComponentInfo{com.rdio.android.ui/rdio.player.RemoteControlReceiver}
05-20 23:24:52.221 D/dalvikvm(14601): GC_EXPLICIT freed 96K, 53% free 3958K/8263K, external 5656K/7218K, paused 45ms
05-20 23:24:52.231 I/monodroid-gc(14601): GC cleanup summary: 214 objects tested - resurrecting 113.
05-20 23:24:52.331 I/ActivityManager(   92): Displayed com.rdio.android.ui/rdio.activities.OAuthAuthorizationActivity: +504ms
05-20 23:24:53.801 D/dalvikvm(14601): GC_EXTERNAL_ALLOC freed 54K, 53% free 3965K/8263K, external 2837K/3471K, paused 50ms
05-20 23:24:54.771 W/DefaultRequestDirector(14922): Authentication error: Unable to respond to any of these challenges: {oauth=Www-Authenticate: OAuth realm="http://www.rdio.com/"}
05-20 23:24:54.771 E/RdioCommonAPI(14922): Request failed with status HTTP/1.1 401 Unauthorized
05-20 23:24:54.781 E/RdioAPIExample2(14922): getCurrentUser failed. 
05-20 23:24:54.781 E/RdioAPIExample2(14922): com.rdio.android.api.services.
RdioAuthorisationException: Request failed with status HTTP/1.1 401 Unauthorized
05-20 23:24:54.781 E/RdioAPIExample2(14922): at com.rdio.android.api.services.RdioCommonAPI.request(Unknown Source)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at com.rdio.android.api.internal.l.a(Unknown Source)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at com.rdio.android.api.b.a(Unknown Source)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at com.rdio.android.api.b.doInBackground(Unknown Source)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at android.os.AsyncTask$2.call(AsyncTask.java:185)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
05-20 23:24:54.781 E/RdioAPIExample2(14922): at java.lang.Thread.run(Thread.java:1019)
05-20 23:24:55.971 D/dalvikvm(14601): GC_EXTERNAL_ALLOC freed 2K, 52% free 3967K/8263K, external 2837K/3509K, paused 42ms
05-20 23:24:56.581 I/RdioAPIExample2(14922): User authorised our app.
05-20 23:24:56.581 I/RdioAPIExample2(14922): Application authorised, saving access token & secret.
05-20 23:24:56.581 D/RdioAPIExample2(14922): Access token: null
05-20 23:24:56.581 D/RdioAPIExample2(14922): Access token secret: null
05-20 23:24:56.601 I/RdioAPIExample2(14922): Getting current user

05-20 23:24:56.761 I/MonoDroid(14601): UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
05-20 23:24:56.761 I/MonoDroid(14601): at Rdio.Activities.OAuthAuthorizationActivity.remove_AllowOAuthActivated (System.EventHandler) <0x00020>
05-20 23:24:56.761 I/MonoDroid(14601): at Rdio.UI.Presenters.OAuthAuthorizationPresenter.Dispose () <0x000ab>
05-20 23:24:56.761 I/MonoDroid(14601): at Rdio.Activities.BaseActivity.OnDestroy () <0x0006b>
05-20 23:24:56.761 I/MonoDroid(14601): at Rdio.Activities.OAuthAuthorizationActivity.OnDestroy () <0x000c3>
05-20 23:24:56.761 I/MonoDroid(14601): at Android.App.Activity.n_OnDestroy (intptr,intptr) <0x00033>
05-20 23:24:56.761 I/MonoDroid(14601): at (wrapper dynamic-method) object.ca2701ca-fa63-44de-a5ce-1ac0a147e539 (intptr,intptr) <0x0002b>
05-20 23:24:56.951 W/DefaultRequestDirector(14922): Authentication error: Unable to respond to any of these challenges: {oauth=Www-Authenticate: OAuth realm="http://www.rdio.com/"}
05-20 23:24:56.951 E/RdioCommonAPI(14922): Request failed with status HTTP/1.1 401 Unauthorized
05-20 23:24:56.951 E/RdioAPIExample2(14922): getCurrentUser failed. 
05-20 23:24:56.951 E/RdioAPIExample2(14922): com.rdio.android.api.services.RdioAuthorisationException: Request failed with status HTTP/1.1 401 Unauthorized
05-20 23:24:56.951 E/RdioAPIExample2(14922): at com.rdio.android.api.services.RdioCommonAPI.request(Unknown Source)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at com.rdio.android.api.internal.l.a(Unknown Source)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at com.rdio.android.api.b.a(Unknown Source)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at com.rdio.android.api.b.doInBackground(Unknown Source)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at android.os.AsyncTask$2.call(AsyncTask.java:185)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
05-20 23:24:56.951 E/RdioAPIExample2(14922): at java.lang.Thread.run(Thread.java:1019)
05-20 23:24:57.371 I/ActivityManager(   92): Process com.rdio.android.ui (pid 14601) has died.
05-20 23:24:57.371 I/WindowManager(   92): WIN DEATH: Window{408b0fd8 com.rdio.android.ui/rdio.PlayerActivity paused=false}
05-20 23:24:57.381 I/RDIO    (14295): PlayerService: About to be destroyed...
05-20 23:24:57.381 E/InputDispatcher(   92): channel '409382b8 com.rdio.android.ui/rdio.activities.SpringboardActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
05-20 23:24:57.381 E/InputDispatcher(   92): channel '409382b8 com.rdio.android.ui/rdio.activities.SpringboardActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-20 23:24:57.381 W/ActivityManager(   92): Scheduling restart of crashed service com.rdio.android.ui/rdio.services.RdioMasterService in 5000ms
05-20 23:24:57.391 I/WindowManager(   92): WIN DEATH: Window{409382b8 com.rdio.android.ui/rdio.activities.SpringboardActivity paused=false}
05-20 23:24:57.391 I/WindowManager(   92): WIN DEATH: Window{4080f450 com.rdio.android.ui/rdio.activities.OAuthAuthorizationActivity paused=false}
05-20 23:24:57.411 I/RDIO    (14295): PlayerService: No longer a foreground process
05-20 23:24:57.411 I/RDIO    (14295): PlaybackStreamHttpProxy: Stopping
05-20 23:24:57.411 I/RDIO    (14295): PlaybackStreamHttpProxy: Stopped
05-20 23:25:02.401 I/ActivityManager(   92): Start proc com.rdio.android.ui for service com.rdio.android.ui/rdio.services.RdioMasterService: pid=14942 uid=10067 gids={3003, 1015, 1007}
05-20 23:25:02.481 I/ActivityThread(14942): Pub com.rdio.android.ui.__mono_init__: mono.MonoRuntimeProvider
05-20 23:25:02.481 D/dalvikvm(14942): Trying to load lib /data/data/com.rdio.android.ui/lib/libmonodroid.so 0x40513e08
05-20 23:25:02.491 D/dalvikvm(14942): Added shared lib /data/data/com.rdio.android.ui/lib/libmonodroid.so 0x40513e08
05-20 23:25:02.721 I/monodroid-gc(14942): environment supports jni NewWeakGlobalRef
05-20 23:25:02.781 I/ActivityThread(14942): Pub com.rdio.SearchSuggestions: rdio.data.RdioSearchProvider
05-20 23:25:03.741 I/RDIO    (14942): Application: OnCreate
05-20 23:25:03.981 I/RDIO    (14942): AndroidApplicationProcess: Foreground started; MemoryUsageLimit = 16 MB; MemoryClass = 32 MB
05-20 23:25:04.401 I/RdioAPIExample2(14922): Track queue depleted, loading more tracks
05-20 23:25:04.451 E/RdioAPIExample2(14922): Track is null!  Size of queue: 0
05-20 23:25:04.491 I/RDIO    (14942): Session: Session initializing. Version 2.1.8, Device ID 7dcb2fa1b1f03890 (9e0f85b6-e6e9-4e73-b3d3-c6f66e38542d)
05-20 23:25:05.311 E/RdioAPIExample2(14922): Failed to handle JSONObject: 
05-20 23:25:05.311 E/RdioAPIExample2(14922): org.json.JSONException: No value for null
05-20 23:25:05.311 E/RdioAPIExample2(14922): at org.json.JSONObject.get(JSONObject.java:354)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at org.json.JSONObject.getJSONObject(JSONObject.java:569)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at com.rdio.android.api.example.ExampleActivity$5.onApiSuccess(ExampleActivity.java:356)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at com.rdio.android.api.b.onPostExecute(Unknown Source)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at android.os.AsyncTask.finish(AsyncTask.java:417)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at android.os.AsyncTask.access$300(AsyncTask.java:127)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at android.os.Handler.dispatchMessage(Handler.java:99)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at android.os.Looper.loop(Looper.java:130)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at android.app.ActivityThread.main(ActivityThread.java:3683)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at java.lang.reflect.Method.invokeNative(Native Method)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at java.lang.reflect.Method.invoke(Method.java:507)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-20 23:25:05.311 E/RdioAPIExample2(14922): at dalvik.system.NativeStart.main(Native Method)
05-20 23:25:05.321 W/InputManagerService(   92): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40868940
05-20 23:25:05.401 I/RDIO    (14942): OfflineSyncCoordinator: Permitted: False, Possible: False, Reason:NotConnected
05-20 23:25:05.421 I/RDIO    (14942): OfflineSyncCoordinator: Can't do anything
05-20 23:25:05.651 I/RDIO    (14942): RdioSecretService: Authentication state change: NotAuthenticated->Authenticated
05-20 23:25:05.731 I/RDIO    (14942): RdioSecretService: Authentication state change: NotAuthenticated->Authenticated
05-20 23:25:05.731 I/RDIO    (14942): Session: Session is initialized.
05-20 23:25:05.761 I/RDIO    (14942): AndroidSession: Network available: WIFI
05-20 23:25:05.781 I/RDIO    (14942): Session: Connection Status Changed: [None] -> [NetworkConnectionAvailable, RdioServiceAccessible]
05-20 23:25:05.791 I/RDIO    (14942): SubscriptionMonitor: Session.IsRdioServiceAccessible = True
05-20 23:25:05.791 I/RDIO    (14942): SubscriptionMonitor: Reloading current user
05-20 23:25:05.811 I/Gmail   (  363): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 4451780, normalSync: true
05-20 23:25:06.191 D/Finsky  (13872): [1] 5.onFinished: Installation state replication succeeded.

Kapil Dalwani

unread,
May 22, 2012, 2:12:42 AM5/22/12
to rdio...@googlegroups.com, Kapil Dalwani
Anyone had a chance to look at it? 

-Kapil

Ian McKellar

unread,
May 22, 2012, 1:33:36 PM5/22/12
to rdio...@googlegroups.com
Hi Kapil,

I haven't had a chance to look into this as much as I'd like to right now, but I can explain a bit of your confusion.

When the SDK starts up, even if the user hasn't authorized your app it will get the rights to do music streaming based on the user that's signed into the Rdio app.

A future version of the SDK will (hopefully) make this clearer.

Are you running the stock example app off github?

Ian

On Sun, May 20, 2012 at 11:34 PM, Kapil Dalwani <kapild...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Rdio API" group.
To post to this group, send email to rdio...@googlegroups.com.
To unsubscribe from this group, send email to rdio-api+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rdio-api?hl=en.



--
Ian McKellar, API, Rdio Inc.
@ian @rdioapi

Kapil Dalwani

unread,
May 22, 2012, 2:28:36 PM5/22/12
to rdio...@googlegroups.com, Ian McKellar
Ian, 

Thanks for the reply. I am using the hello-android fro git-hub. https://github.com/rdio/hello-android

I just want a starting point where I can load my playlist/collections in my android app. In case you have some other app, from which I can fork my app. that would be nice too. 

Currently, I am only able to load the heavy rotations and none of my credentials are being loaded. I am signed on the android rdio app. Somehow, the hello-android app doesn't seem to work. 

Whenever you get a chance kindly have a look! 

Thanks
-Kapil

p.s. Have you tried my rdio google chrome extension? https://chrome.google.com/webstore/detail/mfpbmifgbonadfcggchfijbmelidnbff

Kapil Dalwani

unread,
May 24, 2012, 7:41:00 PM5/24/12
to rdio...@googlegroups.com, Ian McKellar
Hey Ian. 

any chance to have a work on this before the long wekend? any pointers would help. 

I am unable to run the basic android rdip app to get user collections. 

Thanks
-Kapil

Ian McKellar

unread,
May 24, 2012, 8:01:06 PM5/24/12
to Kapil Dalwani, rdio...@googlegroups.com

I'm working on tracking this down at the moment.

Ian

Edward Becker

unread,
May 24, 2012, 11:21:10 PM5/24/12
to rdio...@googlegroups.com
I'm not sure if it ever got through, but I've posted the same issue with the rdio secret and token coming in as null.  Luckily for me the only Auricle.fm users that have my alpha Android app installed are already logged in to the main site, so I just run the auth through the backend.

Kapil Dalwani

unread,
May 25, 2012, 1:30:23 AM5/25/12
to rdio...@googlegroups.com
Ah! So, you faced the same issue. Yeah, the secret and key come out as null and hence the issue. 


-Kapil

Kapil Dalwani

unread,
May 29, 2012, 5:16:42 PM5/29/12
to rdio...@googlegroups.com, Ian McKellar
Hi Ian,

I hope you had a great long weekend. I was checking if you had a chance to go through this :) 

Cheers!

Ian McKellar

unread,
May 29, 2012, 9:01:49 PM5/29/12
to Kapil Dalwani, rdio...@googlegroups.com
Hi Kapil,

I did have a pretty good weekend. We've discovered the problem and are working on releasing a new version of the Rdio Android app this week to correct it. We're in the final testing phases and hoping to get it out in the middle of the week.

Ian

Kapil Dalwani

unread,
May 29, 2012, 9:12:59 PM5/29/12
to i...@rd.io, rdio...@googlegroups.com
Hey Ian!

That's awesome...I will look forward to the new app.

Thanks,
Kapil

Ian McKellar

unread,
Jun 1, 2012, 1:46:52 PM6/1/12
to Kapil Dalwani, rdio...@googlegroups.com
We just pushed a new version of the Android app. It should correct these login issues. Let me know if you're still seeing login problems.

Ian

Kapil Dalwani

unread,
Jun 2, 2012, 2:44:49 PM6/2/12
to i...@rd.io, rdio...@googlegroups.com
Ian,

Thank you for the update. I will update the app and see how it goes. 

Cheers
-Kapil


Reply all
Reply to author
Forward
0 new messages