Ejemplo n.º 1
0
        public Dictionary <string, object> GetWebResponse()
        {
            if (_jwt == null)
            {
                throw new ArgumentNullException("Has not been successfully built.");
            }

            var accessToken = this.GetAccessTokenString();

            var resp = new Dictionary <string, object>();

            resp.Add("access_token", accessToken);
            resp.Add("refresh_token", _refreshToken.GetToken());
            resp.Add("expires_seconds", Expiration.TotalSeconds);

            if (this.VisualiseClaims)
            {
                resp.Add("sub", this.Subject);
                foreach (var r in _additionalClaims)
                {
                    resp.Add(r.Type, r.Value);
                }
            }

            return(resp);
        }