title: How Do I Get the JWT Bearer Token Using B2C and Blazor
body: <p>I've created a new Blazor app using the Visual Studio template adding B2C using the wizard during the project creation.</p>
  
  <p>All works great with authentication. I can sign in using my favorite identity provider and receive the id_token. I don't know where I can get the id_token, but I can see the claims in my user identity.</p>
  
  <p>What I need help with is how do I take the information in the claims to acquire the access token. I need this token to call my endpoints.</p>
  
  <p>This seems like it should be straightforward and a common thing, but I can't seem to find any good examples. </p>
  
  <p>In a normal MVC app, I can get this through the ConfidentialClientApplicationBuilder.AcquireTokenByAuthorizationCode but that doesn't work in Blazor (unless I'm doing something wrong). </p>
  
  <p>I've tried this: <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-access-tokens</a></p>
  
  <p>I think it'll work. How do I get "code"(id_token) in my blazor app? It's what is decoded behind the scenes and all I can find are the claims resulting from decoding the "code". </p>
  
  <p>I've used the azure's "Run user flow" to access an example id_token("code") and pasted it into my project and made the call in the link above and it seems to work. I'm running into permission issues, but it's at least a successful call.</p>
  
  <p>Maybe if I can just get access to the id_token I can make it work from there?</p>