Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I know it's recommended to use Authorization Coe Grant, but I'm running into authentication issues when I try to implement JWT auth.

try
            {
                _docusignAuthenticationService.AuthenticateFromJwt();
            }
            catch (ApiException apiExp)
            {
                // Consent for impersonation must be obtained to use JWT Grant
                if (apiExp.Message.Contains("consent_required"))
                {
                    return Redirect(BuildConsentURL());
                }
            }

private string BuildConsentURL()
        {
            return "https://account-d.docusign.com/oauth/auth" + "?response_type=code" +
                "&scope=signature%20impersonation" +
                "&client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +
                "&redirect_uri=" + "http://localhost:63849";
        }

Am I missing a step in configuring my account to use JWT?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

JWT requires each user consent once for a given app (based on the IK). This can be done per user, or using admin consent - for the entire org. Larry blog post talks all about it. Your code looks correct. Did you hit the exception? did the browser open and ask your for consent? and if so - did you then try again? using the same account?

Update: the issue has to do with having different scopes for consent vs. when making the JWT token request. The set of scopes must be the same and must always include "impersonation."


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...