# Unable to login to Google Apps Enterprise Connection using Firefox

**URL:** <https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724>\
**Category:** Get Help\
**Tags:** google-apps, enterprise-connectio, firefox\
**Created:** [November 13, 2017, 5:32pm UTC](https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724 "2017-11-13T17:32:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brett.rutkowski](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@brett.rutkowski](https://community.auth0.com/u/brett.rutkowski)\
**Post date:** [November 13, 2017, 5:32pm UTC](https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724/1 "2017-11-13T17:32:03Z")

</div>

I have set up a google apps enterprise connection which works perfectly when using chrome or safari, however when I try with firefox v56.0.2 I keep being redirected back to the /login page. There are no console errors being displayed.  
I am using the angular4 02-custom-login-form sample project. Please see code snippets below:

```
auth0 = new auth0.WebAuth({
      domain: AUTH_CONFIG.domain,
      clientID: AUTH_CONFIG.clientID,
      redirectUri: 'http://localhost:4200/callback',
      audience: `https://api-test-3.com`,
      responseType: 'token id_token',
      scope: 'openid'
   });

public loginWithGoogleAppsEnterpriseConnection(): void {
      this.auth0.authorize({
         connection: 'google-apps-enterprise'
      });
   }

```

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [November 14, 2017, 12:05am UTC](https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724/2 "2017-11-14T00:05:20Z")

</div>

I reproduced the issue (application would not show the logged in page in Firefox) with Google social connection instead of enterprise, but the issue does not seem to be specific to connection type so the following workaround should also resolve the situation for you.

In the `auth.service.ts`file perform the following modifications:

- in the `handleAuthentication` method comment/remove the line `window.location.hash = '';`. This was removing the tokens from the URL as quickly as possible, but it was triggering additional navigation that seemed to trigger the issue in Firefox; given the navigation to the home page will also remove the tokens from the URL this line does not seem worth it (personal opinion; use the workaround at your discretion).
- in the `handleAuthentication` method remove the line `this.router.navigate('/home']);` below the `setSession` method call because the `setSession` method already performs the same navigation.

The above is a workaround, but based on what I know it seems a harmless one with no major side-effects. I will also report the issue internally so the official update to the quickstart sample may be different.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [November 14, 2017, 12:46am UTC](https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724/3 "2017-11-14T00:46:33Z")

</div>

As an additional note to my answer, the quickstart sample was also updated with the changes I listed so the issue with the navigation to home page not happening although the user authenticated should now be resolved in Firefox. If you experience other issues or the original one was something else then let me know.

---

<div class="post-metadata">

**Author:** ![brett.rutkowski](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@brett.rutkowski](https://community.auth0.com/u/brett.rutkowski)\
**Post date:** [November 14, 2017, 1:45pm UTC](https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724/4 "2017-11-14T13:45:05Z")

</div>

Hi @jmangelo thanks for your reply.  
The above fix just ensures the user is redirected back to the /home route after successfully logging in, however the main issue I am experiencing with Firefox is the user is unable to log in at all to an enterprise connection.  
I have tested this issue further and it appears to be related to the cookies that are being created on successful login as I am able to log in to an enterprise connection once on firefox if I clear all the cookies, however if I then log out I am unable to log back in to an enterprise connection again unless I clear the cookies.  
Another weird issue is after clearing all cookies I have to call this.auth0.authorize twice before I am redirected to the google oauth login screen.

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/unable-to-login-to-google-apps-enterprise-connection-using-firefox/8724/5 "2018-03-02T05:57:22Z")

</div>


