Conforms to NSObject
Declared in AGAuthzModule.h


AGAuthzModule represents an OAuth2 module and provides an interface for managing OAuth2 dance. The default implementation uses REST as the authz transport. Similar to the Pipe, technical details of the underlying system are not exposed.


Once you have a valid user you can use that information to issue a login against the server, to start accessing protected endpoints:

AGAuthorizer* authorizer = [AGAuthorizer authorizer];

_restAuthzModule = [authorizer authz:^(id<AGAuthzConfig> config) { = @"restAuthMod";
    config.baseURL = [[NSURL alloc] initWithString:@""];
    config.authzEndpoint = @"/o/oauth2/auth";
    config.accessTokenEndpoint = @"/o/oauth2/token";
    config.clientId = @"XXXXXXX";
    config.clientSecret = @"XXXXXXX";
    config.redirectURL = @"org.aerogear.GoogleDrive:/oauth2Callback";
    config.scopes = @[@""];

[_restAuthzModule requestAccessSuccess:^(id object) {
   // object contain the access token needed to query exposed web service
   // You can use ipe as usual
} failure:^(NSError *error) {
    // an error occurred


The requestAccess:success:failure: function deal with the OAuth dance. To manage callback to application, the AeroGear uses URL scheme. Schema should be carefully defined in you plist application.

Time out and Cancel pending operations

As with the case of Pipe, configured timeout interval (in the config object) and cancel operation in AGAuthenticationModule is supported too.