401 error

39 views
Skip to first unread message

ericbrotto

unread,
Jun 29, 2011, 12:14:49 PM6/29/11
to SoundCloudAPI
I am creating an app using the TestApp application that came with the
Coca API wrapper download.

When I use the key and client id and call back URL there is no
problem. I can log into the app using my Soundcloud account and upload
the my tracks at the touch of a button.

When I switch the client id, key and callback URL to the one that I
have listed on my developer account the behavior changes. I can log in
and the app gets registered to my account, but before my username is
posted to the app I get a 401 at this level in the code:


- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
{
#if (NXOAuth2ConnectionDebug)
NSLog(@"%.0fms (SUCC) - %@", -[startDate
timeIntervalSinceNow]*1000.0, [self descriptionForRequest:request]);
#endif

printf("connectionDidFinishLoading\n");

if (sendConnectionDidEndNotification) [[NSNotificationCenter
defaultCenter] postNotificationName:NXOAuth2DidEndConnection
object:self];
sendConnectionDidEndNotification = NO;

printf("connectDidFinishLoading.1\n");

printf("self.statusCode: %d \n", self.statusCode);


Since my app works perfectly fine with the key, id and callback URL
given in the TestApp it is strange to me that when I switch these
values I get the 401.

Any ideas?

Thanks,

Ullrich Schäfer

unread,
Jun 29, 2011, 12:20:05 PM6/29/11
to soundc...@googlegroups.com
Hi there,

Are you speaking of the iOS test app, or the Mac version?
The iOS version runs against the production servers while the Mac version uses the sandbox servers.

Make sure to use the right keys for each environment.

Best,
Ullrich

-- 
Ullrich Schäfer
iOS Team, SoundCloud
Founder & Engineer, nxtbgthng

Rosenthaler Straße 13, 10119 Berlin, Germany

Am Mittwoch, 29. Juni 2011 um 18:14 schrieb ericbrotto:

I am creating an app using the TestApp application that came with the
Coca API wrapper download.

When I use the key and client id and call back URL there is no
problem. I can log into the app using my Soundcloud account and upload
the my tracks at the touch of a button.

When I switch the client id, key and callback URL to the one that I
have listed on my developer account the behavior changes. I can log in
and the app gets registered to my account, but before my username is
posted to the app I get a 401 at this level in the code:


- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
{
#if (NXOAuth2ConnectionDebug)
NSLog(@@"%.0fms (SUCC) - %@", -[startDate

timeIntervalSinceNow]*1000.0, [self descriptionForRequest:request]);
#endif

printf("connectionDidFinishLoading\n");

if (sendConnectionDidEndNotification) [[NSNotificationCenter
defaultCenter] postNotificationName:NXOAuth2DidEndConnection
object:self];
sendConnectionDidEndNotification = NO;

printf("connectDidFinishLoading.1\n");

printf("self.statusCode: %d \n", self.statusCode);


Since my app works perfectly fine with the key, id and callback URL
given in the TestApp it is strange to me that when I switch these
values I get the 401.

Any ideas?

Thanks,

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

ericbrotto

unread,
Jun 29, 2011, 12:40:29 PM6/29/11
to SoundCloudAPI
Thanks for the quick reply Ullrich.

It is an iOS app and I have definitely placed the correct key and id
in the correct spot. The client ID and Secret from souncloud.com (not
sandbox-soundcloud) are plugged into the values directly under

#ifdef kUseProduction

This seems to me the correct thing to do. Also, in my info.plist file
I have the URL identifier

com.imc

and the URL scheme

http://imc

which matches exactly the redirect URI have filed with Soundcloud.
Likewise I have defined my kCallbackURL as

http://imc

Any other thoughts?

-Eric


Any other ideas as to what could be causing this?

-E.

On Jun 29, 5:20 pm, Ullrich Schäfer <ullr...@soundcloud.com> wrote:
> Hi there,
>
> Are you speaking of the iOS test app, or the Mac version?
> The iOS version runs against the production servers while the Mac version uses the sandbox servers.
>
> Make sure to use the right keys for each environment.
>
> Best,
> Ullrich
>
> --
> Ullrich Schäfer
> iOS Team, SoundCloud
> Founder & Engineer, nxtbgthng
>
> http://soundcloud.com/stigihttp://twitter.com/stigi
> Rosenthaler Straße 13, 10119 Berlin, Germany
>
> Am Mittwoch, 29. Juni 2011 um 18:14 schrieb ericbrotto:
>
>
>
>
>
>
>
> > I am creating an app using the TestApp application that came with the
> > Coca API wrapper download.
>
> > When I use the key and client id and call back URL there is no
> > problem. I can log into the app using my Soundcloud account and upload
> > the my tracks at the touch of a button.
>
> > When I switch the client id, key and callback URL to the one that I
> > have listed on my developer account the behavior changes. I can log in
> > and the app gets registered to my account, but before my username is
> > posted to the app I get a 401 at this level in the code:
>
> > - (void)connectionDidFinishLoading:(NSURLConnection *)connection;
> > {
> > #if (NXOAuth2ConnectionDebug)
> >  NSLog(@"%.0fms (SUCC) - %@", -[startDate
> > timeIntervalSinceNow]*1000.0, [self descriptionForRequest:request]);
> > #endif
>
> >  printf("connectionDidFinishLoading\n");
>
> >  if (sendConnectionDidEndNotification) [[NSNotificationCenter
> > defaultCenter] postNotificationName:NXOAuth2DidEndConnection
> > object:self];
> >  sendConnectionDidEndNotification = NO;
>
> >  printf("connectDidFinishLoading.1\n");
>
> >  printf("self.statusCode: %d \n", self.statusCode);
>
> > Since my app works perfectly fine with the key, id and callback URL
> > given in the TestApp it is strange to me that when I switch these
> > values I get the 401.
>
> > Any ideas?
>
> > Thanks,
>
> > --
> > You received this message because you are subscribed to the Google Groups "SoundCloudAPI" group.
> > To post to this group, send email to soundc...@googlegroups.com (mailto:soundc...@googlegroups.com).
> > To unsubscribe from this group, send email to soundcloudap...@googlegroups.com (mailto:soundcloudap...@googlegroups.com).
Reply all
Reply to author
Forward
0 new messages