Пример #1
0
    protected void IdentityEndpoint20_NormalizeUri(object sender, IdentityEndpointNormalizationEventArgs e)
    {
        // This sample Provider has a custom policy for normalizing URIs, which is that the whole
        // path of the URI be lowercase except for the first letter of the username.
        UriBuilder normalized = new UriBuilder(e.UserSuppliedIdentifier);
        string     username   = Request.QueryString["username"].TrimEnd('/').ToLowerInvariant();

        username               = username.Substring(0, 1).ToUpperInvariant() + username.Substring(1);
        normalized.Path        = "/user/" + username;
        normalized.Scheme      = "http";    // for a real Provider, this should be HTTPS if supported.
        e.NormalizedIdentifier = normalized.Uri;
    }
Пример #2
0
        protected void IdentityEndpoint20_NormalizeUri(object sender, IdentityEndpointNormalizationEventArgs e)
        {
            string username = Util.ExtractUserName(Page.Request.Url);

            e.NormalizedIdentifier = new Uri(Util.BuildIdentityUrl(username));
        }