Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot log in #25

Open
DarrenBranford opened this issue Mar 20, 2015 · 10 comments
Open

Cannot log in #25

DarrenBranford opened this issue Mar 20, 2015 · 10 comments

Comments

@DarrenBranford
Copy link

@seanoshea After successfully cloning the CocoaPod (thank you for fixing that) I found that I am unable to log in. The log message does not provide an error.

2015-03-20 15:20:37.081 RisingBetObjC[27020:1329145] There was an error while logging in (null) (null)

I added another NSLog to try to capture some more info.

2015-03-20 15:20:37.080 RisingBetObjC[27020:1329145] ssokey: (null), NSError: (null), BNGError: (null)

That seems to suggest that the ssoKey is not being generated/passed on.

For reference, my setup looks like this:

NSString *appKey    = @"E33v9H5bQlILMvtN";
NSString *scheme    = @"https";
NSString *product   = @"E33v9H5bQlILMvtN";
NSString *username  = @"Real_Username_Removed";
NSString *password  = @"Real_Password_Removed";

The appKey has been whitelisted and my client is enrolled in the vendor program.

Any help would be greatly appreciated.

@seanoshea
Copy link
Contributor

@DarrenBranford I'll try to take a look at the weekend.

Can you double check with the Betfair (cc @jamiei) guys that the scheme should be https too? I think it might need to be something different, but I can't remember off the top of my head. My understanding is that the login mechanism is a little odd and while you'd think that https would be the logical scheme choice here, I think it changes on an app-by-app basis.

In the meantime, if you could post your the full code that you are using to try and authenticate to this bug report, it would help in figuring out what the root cause of the problem is. For example, does it look something like:

NSString *appKey    = @"E33v9H5bQlILMvtN";
NSString *scheme    = @"https";
NSString *product   = @"E33v9H5bQlILMvtN";
NSString *username  = @"Real_Username_Removed";
NSString *password  = @"Real_Password_Removed";

[[APING sharedInstance] registerApplicationKey:appKey ssoKey:nil];
// need to register the login URL protocol which the redirect url will hit once the login API call succeeds.
[BNGLoginURLProtocol registerWithScheme:scheme];

- (void)authenticateForUsername:(NSString *)username password:(NSString *)password product:(NSString *)product scheme:(NSString *)scheme
{
    NSURLRequest *request = [BNGAccount loginWithUserName:username password:password product:product redirectUrl:[scheme stringByAppendingString:@"://ios.betfair.com/login"] completionBlock:^(NSString *ssoKey, NSError *connectionError, BNGAPIError *apiError) {

    if (!connectionError && !apiError && ssoKey.length) {

If it looks something like that, it might be worthwhile to take a look at the connectionError and apiError variables in the callback block and see whether they have any additional information?

@DarrenBranford
Copy link
Author

@seanoshea Thanks, I will double check the scheme. I was actually using the example project to try to log in, so the code is the same.

The connectionError and apiError are both null.

@seanoshea
Copy link
Contributor

@DarrenBranford yep - I believe you can do a non-interactive login using HTTPS (ala a bot - most of the Betfair sample code are based off this), but the iOS APING client expects an interactive login as far as I can remember.

@jamiei
Copy link

jamiei commented Mar 20, 2015

@seanoshea What is *scheme used for in this instance?

The documentation for the non-interactive login (https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Interactive+Login+-+Desktop+Application) specifies both the non-interactive login URLs and the default redirect URLs as https.

@seanoshea
Copy link
Contributor

@jamiei It's the redirectURL I believe. This is the url that identitysso POSTs back to when the login was successful. See the url parameter at https://github.com/betfair/aping-ios-sdk/blob/master/BNGAPI/BNGAPI/Classes/BNGAccount.m

@DarrenBranford
Copy link
Author

@seanoshea Thanks for the clarification regarding interactive and non-interactive login; I had previously got the interactive login up and running before I came across this repository, but was experiencing "DSC-0024" when making any other calls to the API. I was hoping that the SDK would help me trace my problem.

@seanoshea
Copy link
Contributor

Looks like DSC-0024 is:

@"DSC-0024" : @(BNGAPICougarErrorCodeRescriptDeserialisationFailure),

but I'm not sure what the correct recourse to that issue is. If we can figure out what the correct scheme parameter is for the login API call, I think all the rest of the API calls should fall into place.

@nugster
Copy link

nugster commented Jun 11, 2015

@seanoshea the correct scheme is https but the login request still appears to be broken.

Can you confirm that the parameters required via BNGExampleViewController.m are used to construct the URL below?

https://identitysso.betfair.com/view/login?product=&url=

Using ://www.betfair.com instead of ://ios.betfair.com/login also doesn't work as the redirect URL for a white-listed App Key.

@seanoshea
Copy link
Contributor

@nugster - yep, the parameters in the BNGExampleViewController are used to construct the login url.

@bjm3
Copy link

bjm3 commented May 28, 2016

Has this been fixed? I am having similar issues regarding logging in. I am using the sample BNGExampleApplication supplied with the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants