GIDAuthorizationFlowProcessor.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2023 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. @class GIDSignInInternalOptions;
  19. @class OIDAuthorizationResponse;
  20. @protocol GIDAuthorizationFlowProcessor <NSObject>
  21. /// The state of the authorization flow.
  22. @property(nonatomic, readonly, getter=isStarted) BOOL start;
  23. /// Starts the authorization flow.
  24. ///
  25. /// @param options The @GIDSignInInternalOptions object to provide serverClientID, hostedDomain,
  26. /// clientID, scopes, loginHint and extraParams.
  27. /// @param completion The block that is called on completion asynchronously.
  28. - (void)startWithOptions:(GIDSignInInternalOptions *)options
  29. emmSupport:(nullable NSString *)emmSupport
  30. completion:(void (^)(OIDAuthorizationResponse *_Nullable authorizationResponse,
  31. NSError *_Nullable error))completion;
  32. /// Handles the custom scheme URL opened by SFSafariViewController to cleanup UI on iOS 10.
  33. ///
  34. /// @param url The redirect URL invoked by the server.
  35. /// @return YES if the passed URL matches the expected redirect URL and was consumed, NO otherwise.
  36. - (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)url;
  37. /// Cancels the authorization flow.
  38. - (void)cancelAuthenticationFlow;
  39. @end
  40. NS_ASSUME_NONNULL_END