# showAuthPage

> The Alipay+ client SDK calls the showAuthPage API to display the authorization page for the user to proceed with the authorization.

The Alipay+ client SDK calls the **showAuthPage** API to display the authorization page for the user to proceed with the authorization.

## Method signature

```objectivec
NS_ASSUME_NONNULL_BEGIN
@protocol MPPAlipayPlusClientAutoDebitProtocol <NSObject>
- (void)showAuthPage:(MPPSignContractOAuthServiceParams *)params
             completionHandler:(void(^)(MPPSignContractOAuthServiceResult * _Nullable result, NSError * _Nullable error))completionHandler;
@end
NS_ASSUME_NONNULL_END
```

## Request parameters

| **Item** | **Type** | **Description** | **Required** |
| --- | --- | --- | --- |
| params | [MPPSignContractOAuthServiceParams](ios_appendix#ZUE1t) | Parameters that are required to render the authorization page. | M |
| completionHandler | iOS block | The callback to be invoked after the authorization process ends. See [completionHandler](#c5dJm) for details. | M |

#### completionHandler

| **Item** | **Type** | **Description** | **Required** |
| --- | --- | --- | --- |
| result | [MPPSignContractOAuthServiceResult](ios_appendix#ZN1i2) | The authorization information that is required if the authorization is successful. | O |
| error | NSError | The error that is required if the authorization fails. | O |

## Response parameters

N/A

## Sample

Definition of _YOUR\_AUTODEBIT\_SERVICE\_CLASS_:

```objectivec
@interface YOUR_AUTODEBIT_SERVICE_CLASS: NSObject <MPPAlipayPlusClientAutoDebitProtocol>
- (void)showAuthPageWithParams:(MPPSignContractOAuthServiceParams *)params
             completionHandler:(void(^)(MPPSignContractOAuthServiceResult * _Nullable result, NSError * _Nullable error))callback;
@end

@implementation YOUR_AUTODEBIT_SERVICE_CLASS
- (void)showAuthPageWithParams:(MPPSignContractOAuthServiceParams *)params
             completionHandler:(void(^)(MPPSignContractOAuthServiceResult * _Nullable result, NSError * _Nullable error))callback; {

  //Open the authUrl

  //Callback when user confirms authorization
  callback(result, nil);

  }
@end
```

Instance of _YOUR\_AUTODEBIT\_SERVICE\_CLASS_:

```objectivec
#import <MPPAlipayPlusClientAutoDebit/MPPAlipayPlusClientAutoDebit.h>

[AlipayPlustClient shared].autoDebitService = YOUR_AUTODEBIT_SERVICE_CLASS.new
```

###