Start a HTTP server on the loopback interface (i.e. 127.0.0.1
) to receive the OAuth response redirects on macOS.
More...
#import <OIDRedirectHTTPHandler.h>
|
id< OIDExternalUserAgentSession > | currentAuthorizationFlow |
| The external user-agent request flow session which receives the return URL from the browser. @discussion The loopback HTTP server will try sending incoming request URLs to the OAuth redirect handler to continue the flow. This should be set while an external user-agent request flow is in progress.
|
|
Start a HTTP server on the loopback interface (i.e. 127.0.0.1
) to receive the OAuth response redirects on macOS.
◆ initWithSuccessURL:()
- (instancetype) initWithSuccessURL: |
|
(nullable NSURL *) |
successURL |
|
Creates an a loopback HTTP redirect URI handler with the given success URL.
- Parameters
-
successURL | The URL that the user is redirected to after the external user-agent request flow completes either with a result of success or error. The contents of this page should instruct the user to return to the app. @discussion Once you have initiated the external user-agent request, be sure to set currentAuthorizationFlow on this object so that any responses received by this listener will be routed accordingly. |
◆ startHTTPListener:()
- (NSURL *) startHTTPListener: |
|
(NSError **) |
returnError |
|
Starts listening on the loopback interface on a random available port, and returns a URL with the base address. Use the returned redirect URI to build a OIDExternalUserAgentRequest
, and once you initiate the request, set the resulting OIDExternalUserAgentSession
to currentAuthorizationFlow
so the response can be handled.
- Parameters
-
returnError | The error if an error occurred while starting the local HTTP server. |
- Returns
- The URL containing the address of the server with the randomly assigned available port. @discussion Each instance of
OIDRedirectHTTPHandler
can only listen for a single response. Calling this more than once will result in the previous listener being cancelled (equivalent of cancelHTTPListener
being called).
◆ startHTTPListener:withPort:()
Starts listening on the loopback interface on a specified port, and returns a URL with the base address. Use the returned redirect URI to build a OIDExternalUserAgentRequest
, and once you initiate the request, set the resulting OIDExternalUserAgentSession
to currentAuthorizationFlow
so the response can be handled.
- Parameters
-
returnError | The error if an error occurred while starting the local HTTP server. |
port | The manually specified port, or 0 for a random available port. |
- Returns
- The URL containing the address of the server with the specified port, or nil if there was an error. @discussion Each instance of
OIDRedirectHTTPHandler
can only listen for a single response. Calling this more than once will result in the previous listener being cancelled (equivalent of cancelHTTPListener
being called).
The documentation for this class was generated from the following file: