[aerogear-dev] Possible error in oauth2Type method in AGAuthorizer.m

Yagyesh yagyesh.agrawal at itpeoplecorp.com
Mon Jun 9 02:40:49 EDT 2014


I'm working on an example using auth functionality of AeroGear. The method
oauth2Type is currently implemented as follows:

- (NSString*)oauth2Type:(AGAuthzConfiguration*)config {
    if ([*config.authzEndpoint* rangeOfString:@"facebook"].location !=
NSNotFound) {
        return @"AG_OAUTH2_FACEBOOK";
    }
    return @"AG_OAUTH2";
}

Now, config.authzEndpoint will have values like "/o/oauth2/auth" or maybe
"/dialog/oauth" in case of facebook. Thus the check above will always result
in false & the return type will always be "AG_OAUTH2". 

Shouldnt the method be instead checking *config.baseURL.host* ? 



--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/Possible-error-in-oauth2Type-method-in-AGAuthorizer-m-tp8116.html
Sent from the aerogear-dev mailing list archive at Nabble.com.


More information about the aerogear-dev mailing list