title: How to get access token through redirect url browser in Officejs excel add-in
body: <p>When trying to implement below logic we were able to get access token in redirect url browser like
  <a href="https://localhost:3000/taskpane.html#id_token=" rel="nofollow noreferrer">https://localhost:3000/taskpane.html#id_token=</a>"xxxxxxxx...."  but not able to get in origin like in taskpane.ts file.</p>
  
  <p>Code in taskpane.ts:</p>
  
  <pre><code>if (OfficeHelpers.Authenticator.isAuthDialog())
  return;
  
  let authenticator = new OfficeHelpers.Authenticator;
  
  authenticator.endpoints.add('OauthTest', {
  baseUrl:"https://qa-xxxx.xxxx.com/",
  authorizeUrl: "/connect/authorize",
  tokenUrl: "/connect/token",
  clientId: "https://qa-xxxx.xxxx.com/",
  responseType: "id_token",
  redirectUrl: "https://localhost:3000/taskpane.html",
  scope:"openid profile",
  state: true,
  nonce:true
  })
  authenticator
  .authenticate('OauthTest',true)
  .then(token =&gt; {
  var test=token;
  let authObject = authenticator.tokens.get("OauthTest");
  let accessToken = authObject.access_token;
  console.log(JSON.stringify(token1));
  console.log(OfficeHelpers.Authenticator.getUrlParams());
  })
  .catch(OfficeHelpers.Utilities.log);
  </code></pre>
  
  <p>In Manifest :</p>
  
  <p><a href="https://localhost:3000" rel="nofollow noreferrer">https://localhost:3000</a>,
  <a href="https://localhost:3000/taskpane.html" rel="nofollow noreferrer">https://localhost:3000/taskpane.html</a>,
  <a href="https://qa-xxxx.xxxx.com" rel="nofollow noreferrer">https://qa-xxxx.xxxx.com</a> </p>
  
  <p>Issue: </p>
  
  <blockquote>
    <p>Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<a href="https://qa-xxxx.xxxx.com" rel="nofollow noreferrer">https://qa-xxxx.xxxx.com</a>') does not match the recipient window's origin ('<a href="https://localhost:3000" rel="nofollow noreferrer">https://localhost:3000</a>').</p>
  </blockquote>