FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    How to get JWT token in Angular app

    Scheduled Pinned Locked Moved
    General Discussion
    2
    2
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aponski
      last edited by

      Hi, in my Angular application I need to get auth user JWT token to use it in authorization header when sending request to Hasura graphQL server. I don't have that option to access JWT token in @fusionauth/angular-sdk. I see that token is stored in "app.at" cookie but it is httponly cookie so I don't have access to it with javascript.

      M 1 Reply Last reply Reply Quote 0
      • M
        michaelgaffney278 @aponski
        last edited by

        @aponski said in How to get JWT token in Angular app:

        Hi, in my Angular application I need to get auth user JWT token to use it in authorization header when sending request to Hasura graphQL server. I don't have that option to access JWT token in @fusionauth/angular-sdk. I see that token is stored in "app.at" cookie but it is httponly cookie so I don't have access to it with javascript.

        What you’re running into isn’t a limitation of Angular—it’s an intentional security design of FusionAuth Angular SDK and modern auth flows. You’re not supposed to read the JWT from an HttpOnly cookie in the browser. That’s exactly what HttpOnly is meant to prevent.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post