AuthBridge.SecurityTokenService.MultiProtocolSecurityTokenService.GetScope C# (CSharp) Метод

GetScope() защищенный Метод

protected GetScope ( ClaimsPrincipal principal, RequestSecurityToken request ) : Scope
principal ClaimsPrincipal
request RequestSecurityToken
Результат Scope
        protected override Scope GetScope(ClaimsPrincipal principal, RequestSecurityToken request)
        {
            this.scopeModel = this.ValidateAppliesTo(new EndpointAddress(request.AppliesTo.Uri));

            var scope = new Scope(request.AppliesTo.Uri.OriginalString, SecurityTokenServiceConfiguration.SigningCredentials);
            scope.TokenEncryptionRequired = false;

            string replyTo;
            if (!string.IsNullOrEmpty(request.ReplyTo))
            {
                replyTo = request.ReplyTo;
                if (ConfigurationManager.AppSettings.GetBoolSetting("UseRelativeConfiguration"))
                {
                    var uri = new Uri(replyTo);
                    if (uri.IsAbsoluteUri)
                    {
                        replyTo = new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped)).MakeRelativeUri(uri).ToString();
                    }
                }
            }
            else if (scopeModel.Url != null)
            {
                replyTo = scopeModel.Url.ToString();
                if (ConfigurationManager.AppSettings.GetBoolSetting("UseRelativeConfiguration"))
                {
                    replyTo =
                        new Uri(
                            new Uri(HttpContext.Current.Request.Url.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped)),
                            new Uri(scopeModel.Url.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped))
                                .MakeRelativeUri
                                (
                                    scopeModel.Url)).ToString();
                }
            }
            else
            {
                replyTo = scope.AppliesToAddress;
            }
            scope.ReplyToAddress = replyTo;

            return scope;
        }