internal static MobileConnectStatus StartAuthorization(IAuthentication authentication, DiscoveryResponse discoveryResponse, string encryptedMSISDN, string state, string nonce, MobileConnectConfig config, MobileConnectRequestOptions options) { StartAuthenticationResponse response; try { string clientId = discoveryResponse?.ResponseData?.response?.client_id ?? config.ClientId; string authorizationUrl = discoveryResponse?.OperatorUrls?.AuthorizationUrl; response = authentication.StartAuthentication(clientId, authorizationUrl, config.RedirectUrl, state, nonce, config.AuthorizationScope, config.AuthorizationMaxAge, config.AuthorizationAcrValues, encryptedMSISDN, options?.AuthenticationOptions); } catch (MobileConnectInvalidArgumentException e) { return(MobileConnectStatus.Error("invalid_argument", string.Format("An argument was found to be invalid during the process. The argument was {0}.", e.Argument), e)); } catch (Exception e) { return(MobileConnectStatus.Error("unknown_error", "An unknown error occured while generating an authorization url", e)); } return(MobileConnectStatus.Authorization(response.Url, state, nonce)); }