public static void SetAuthenticationContinuationEventArgs(int requestCode, Result resultCode, Intent data) { LastRequestLogger?.Info($"SetAuthenticationContinuationEventArgs - resultCode: {(int)resultCode} requestCode: {requestCode}"); AuthorizationResult authorizationResult; if (data?.Action?.Equals("ReturnFromEmbeddedWebview", StringComparison.OrdinalIgnoreCase) == true) { authorizationResult = ProcessFromEmbeddedWebview(requestCode, resultCode, data); WebviewBase.SetAuthorizationResult(authorizationResult, LastRequestLogger); return; } if (data != null && (!string.IsNullOrEmpty(data.GetStringExtra(BrokerConstants.BrokerResultV2)) || requestCode == BrokerConstants.BrokerRequestId)) { //The BrokerRequestId is an ID that is attached to the activity launch during brokered authentication // that indicates that the response returned to this class is for the broker. LastRequestLogger?.Info("Processing result from broker."); AndroidBroker.SetBrokerResult(data, (int)resultCode, LastRequestLogger); return; } if (data != null || AndroidConstants.AuthCodeReceived != (int)resultCode) { LastRequestLogger?.Info("Processing result from system webview."); authorizationResult = ProcessFromSystemWebview(requestCode, resultCode, data); WebviewBase.SetAuthorizationResult(authorizationResult, LastRequestLogger); return; } LastRequestLogger?.Info("SetAuthenticationContinuationEventArgs - ignoring intercepted null intent."); }
public static void SetAuthenticationContinuationEventArgs(int requestCode, Result resultCode, Intent data) { // TODO(migration): how can a public static method get access to the proper ClientRequestBase to wire into the logger and appropriate requestcontext? // Can we move this call to be somewhere on the ClientApplicationBase or something else that's wired into that? var logger = MsalLogger.Create(Guid.Empty, null); logger.Info(string.Format(CultureInfo.InvariantCulture, "Received Activity Result({0})", (int)resultCode)); AuthorizationResult authorizationResult; if (data.Action != null && data.Action.Equals("ReturnFromEmbeddedWebview", StringComparison.OrdinalIgnoreCase)) { authorizationResult = ProcessFromEmbeddedWebview(requestCode, resultCode, data); } else if (!String.IsNullOrEmpty(data.GetStringExtra(BrokerConstants.BrokerResultV2))) { AndroidBroker.SetBrokerResult(data, (int)resultCode); return; } else { authorizationResult = ProcessFromSystemWebview(requestCode, resultCode, data); } WebviewBase.SetAuthorizationResult(authorizationResult, logger); }
public static void SetAuthenticationContinuationEventArgs(int requestCode, Result resultCode, Intent data) { RequestContext requestContext = new RequestContext(null, new MsalLogger(Guid.Empty, null)); requestContext.Logger.Info(string.Format(CultureInfo.InvariantCulture, "Received Activity Result({0})", (int)resultCode)); AuthorizationResult authorizationResult = null; int code = (int)resultCode; if (data.Action != null && data.Action.Equals("ReturnFromEmbeddedWebview", StringComparison.OrdinalIgnoreCase)) { authorizationResult = ProcessFromEmbeddedWebview(requestCode, resultCode, data); } else { authorizationResult = ProcessFromSystemWebview(requestCode, resultCode, data); } WebviewBase.SetAuthorizationResult(authorizationResult, requestContext); }