Commit edf83fed authored by Scott Nichols's avatar Scott Nichols Committed by Commit Bot

Display an error if a user attempts to connect to a host that requires 3rd party auth.

Change-Id: If4e7534748cd2149916dad57b21d875666aa5b71
Reviewed-on: https://chromium-review.googlesource.com/567026Reviewed-by: default avatarYuwei Huang <yuweih@chromium.org>
Commit-Queue: Scott Nichols <nicholss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485987}
parent cf46e15f
...@@ -577,6 +577,9 @@ static const CGFloat kKeyboardAnimationTime = 0.3; ...@@ -577,6 +577,9 @@ static const CGFloat kKeyboardAnimationTime = 0.3;
// If the session closes, offer the user to reconnect. // If the session closes, offer the user to reconnect.
state = ClientViewReconnect; state = ClientViewReconnect;
break; break;
case SessionCancelled:
state = ClientViewClosed;
break;
default: default:
LOG(ERROR) << "Unknown State for Session, " << sessionDetails.state; LOG(ERROR) << "Unknown State for Session, " << sessionDetails.state;
return; return;
......
...@@ -20,6 +20,7 @@ typedef NS_ENUM(NSInteger, SessionState) { ...@@ -20,6 +20,7 @@ typedef NS_ENUM(NSInteger, SessionState) {
SessionConnected, SessionConnected,
SessionFailed, SessionFailed,
SessionClosed, SessionClosed,
SessionCancelled,
}; };
// Session states that map to |remoting::protocol::ConnectionToHost::Error|. // Session states that map to |remoting::protocol::ConnectionToHost::Error|.
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#import "base/mac/bind_objc_block.h" #import "base/mac/bind_objc_block.h"
#import "ios/third_party/material_components_ios/src/components/Dialogs/src/MaterialDialogs.h" #import "ios/third_party/material_components_ios/src/components/Dialogs/src/MaterialDialogs.h"
#import "ios/third_party/material_components_ios/src/components/Snackbar/src/MaterialSnackbar.h"
#import "remoting/ios/display/gl_display_handler.h" #import "remoting/ios/display/gl_display_handler.h"
#import "remoting/ios/domain/client_session_details.h" #import "remoting/ios/domain/client_session_details.h"
#import "remoting/ios/domain/host_info.h" #import "remoting/ios/domain/host_info.h"
...@@ -301,7 +302,18 @@ NSString* const kHostSessionPin = @"kHostSessionPin"; ...@@ -301,7 +302,18 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
- (void)fetchThirdPartyTokenForUrl:(NSString*)tokenUrl - (void)fetchThirdPartyTokenForUrl:(NSString*)tokenUrl
clientId:(NSString*)clientId clientId:(NSString*)clientId
scope:(NSString*)scope { scope:(NSString*)scope {
NSLog(@"TODO(nicholss): implement this, fetchThirdPartyTokenForUrl."); // Not supported for iOS yet.
_sessionDetails.state = SessionCancelled;
[self disconnectFromHost];
NSString* message = [NSString
stringWithFormat:@"[ThirdPartyAuth] Unable to authenticate with %@.",
_sessionDetails.hostInfo.hostName];
[MDCSnackbarManager showMessage:[MDCSnackbarMessage messageWithText:message]];
[[NSNotificationCenter defaultCenter]
postNotificationName:kHostSessionStatusChanged
object:self
userInfo:[NSDictionary dictionaryWithObject:_sessionDetails
forKey:kSessionDetails]];
} }
- (void)setCapabilities:(NSString*)capabilities { - (void)setCapabilities:(NSString*)capabilities {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment