# Deploying to Azure Static Website problem

**URL:** <https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779>\
**Category:** Get Help\
**Tags:** azure, website, callback-urls, login\
**Created:** [November 9, 2018, 10:29pm UTC](https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779 "2018-11-09T22:29:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danbord](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/danbord/32/9615_2.png) [@danbord](https://community.auth0.com/u/danbord)\
**Post date:** [November 9, 2018, 10:29pm UTC](https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779/1 "2018-11-09T22:29:39Z")

</div>

Hello,

I’m considering deploying my Angular WebApp to the Azure Storage Static Website hosting. That methods of deploying my SPA is forcing me to use hash path for my routing.

Then my callback url from Auth0 must contains the hash too! But as I read on other threads here it seems impossible.

What are my options?

Daniel

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [November 10, 2018, 11:35am UTC](https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779/2 "2018-11-10T11:35:34Z")

</div>

Hi @danbord

You can use the same root path of your application to be the callback URL. In the callback, you will be redirected with the authorization response in the fragment, something that looks like this:

```auto
https://yourapp.com#access_token=xxxx&expires_in=xxx&token_type=Bearar&id_token=xxx&...

```

At the start of your application logic you can use Auth0.js’ [parseHash method](https://github.com/auth0/auth0.js#api) to check for a valid authorization response and act accordingly:

```plaintext
auth0.parseHash(function(err, authResult) {
  if (err) {
    // this means an error came from a previous authorization request
    return console.log(err);
  } else if (authResult) {
    // if you land here, it means that the fragment had a valid authorization response
    //
    // The contents of authResult depend on which authentication parameters were used.
    // It can include the following:
    // authResult.accessToken - access token for the API specified by `audience`
    // authResult.expiresIn - string with the access token's expiration time in seconds
    // authResult.idToken - ID token JWT containing user profile information
  } else {
    // no authentication result found in the fragment
    // continue with the regular application startup flow
  }
});

```

---

<div class="post-metadata">

**Author:** ![danbord](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/danbord/32/9615_2.png) [@danbord](https://community.auth0.com/u/danbord)\
**Post date:** [November 10, 2018, 12:35pm UTC](https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779/3 "2018-11-10T12:35:17Z")

</div>

Hello @nicolas_sabena ,

thanks for your answer, but it does not seems to work as my angular app seems to override the hash part when the route does not actually exists.

I tried to check the **window.location.hash** from the **ngOnInit** of my **app.component.ts**.

Then try a url like **[http://localhost:4200#test](http://localhost:4200#test)**. Result : it just redirects me to **[http://localhost:4200/#/](http://localhost:4200/#/)** without entering the app ngOnInit

Daniel

---

<div class="post-metadata">

**Author:** ![danbord](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/danbord/32/9615_2.png) [@danbord](https://community.auth0.com/u/danbord)\
**Post date:** [November 10, 2018, 2:01pm UTC](https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779/4 "2018-11-10T14:01:37Z")

</div>

Oh, nevermind I got it to work! 😃

When typing the hash manually in the url bar (when the site is already loaded) it ignores it when the route does not exists. But loading the url with the hash from another page it works.

In the end, I’m finally using a RouteGuard to process it.

Thanks

Dan

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 10, 2018, 2:01pm UTC](https://community.auth0.com/t/deploying-to-azure-static-website-problem/17779/5 "2018-12-10T14:01:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
