Ejemplo n.º 1
0
 private static string GetRedirectUrl(BankIdSupportedDevice device, LaunchUrlRequest request)
 {
     // Only use redirect url for iOS as recommended in BankID Guidelines 3.1.2
     return(device.IsIos
         ? request.RedirectUrl
         : "null");
 }
Ejemplo n.º 2
0
        public string GetLaunchUrl(BankIdSupportedDevice device, LaunchUrlRequest request)
        {
            var prefix      = GetPrefixPart(device);
            var queryString = GetQueryStringPart(device, request);

            return($"{prefix}{queryString}");
        }
Ejemplo n.º 3
0
        public string GetLaunchUrl(BankIdSupportedDevice device, LaunchUrlRequest request)
        {
            if (device.IsIos)
            {
                return(request.RedirectUrl);
            }

            return("#");
        }
Ejemplo n.º 4
0
        private string GetQueryStringPart(BankIdSupportedDevice device, LaunchUrlRequest request)
        {
            var queryStringParams = new Dictionary <string, string>();

            if (!string.IsNullOrWhiteSpace(request.AutoStartToken))
            {
                queryStringParams.Add("autostarttoken", request.AutoStartToken);
            }

            if (!string.IsNullOrWhiteSpace(request.RelyingPartyReference))
            {
                queryStringParams.Add("rpref", Base64Encode(request.RelyingPartyReference));
            }

            queryStringParams.Add("redirect", GetRedirectUrl(device, request));

            return(GetQueryString(queryStringParams));
        }