Beispiel #1
0
        public Task CreateLinksFor(UserInfoResponse response)
        {
            if (response == null)
            {
                return(Task.CompletedTask);
            }

            response.Links = new[] {
                _hyperlinkFactory.Create(HttpMethod.Get, $"/api/userinfo", UserInfoResponseHyperlinkType.Self),
                _hyperlinkFactory.Create(HttpMethod.Get, $"/api", UserInfoResponseHyperlinkType.GetApiRoot)
            };

            return(Task.CompletedTask);
        }
Beispiel #2
0
        public Task CreateLinksFor(Claim claim)
        {
            if (claim == null)
            {
                return(Task.CompletedTask);
            }

            var urlEncodedClaimType = WebUtility.UrlEncode(claim.Type);

            claim.Links = new[] {
                _hyperlinkFactory.Create(HttpMethod.Get, $"/api/userinfo/{urlEncodedClaimType}", ClaimHyperlinkType.EnumerateAllClaimsOfThisType),
                _hyperlinkFactory.Create(HttpMethod.Get, $"/api/userinfo", ClaimHyperlinkType.GetUserInfo)
            };

            return(Task.CompletedTask);
        }