question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authorisation not sent (possibly whitelist issue)

See original GitHub issue

Exactly the same issue as here https://github.com/auth0/angular2-jwt/issues/464

It was closed because he ditched auth0 however, that is not an option for us.

Locally it works locally with http using whitelist: ['localhost:3000'], how when deployed on https, with or without the port in the whitelist it fails whitelist: ['api.server.com:443']

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:29 (7 by maintainers)

github_iconTop GitHub Comments

15reactions
eddiejaoudecommented, Feb 2, 2018

I got this to work by changing from the default setup…

JwtModule.forRoot({
      config: {
        tokenGetter: () => {
          return localStorage.getItem('access_token');
        },
        whitelistedDomains: [environment.whitelist]
      }
    }),

to the custom setup…

export function jwtOptionsFactory() {
  return {
    tokenGetter: () => {
      return localStorage.getItem('access_token');
    },
    whitelistedDomains: environment.whitelist
  }
}

JwtModule.forRoot({
          jwtOptionsProvider: {
            provide: JWT_OPTIONS,
            useFactory: jwtOptionsFactory
          }
        }),

Where environment is…

export const environment = {
  production: true,
  api: 'https://example.io',
  whitelist: ['example.io', 'https://example.io', 'example:443'],
  version: 'x.x.x',
};

Shortly, I will investigate further to understand more, but hopefully that helps someone.

4reactions
tobiasettercommented, Mar 29, 2018

@PartyArk Your workaround does not work for me. This is the error that I am getting because of the regex:

ERROR in app\app.module.ts(97,11): Error during template compile of 'AppModule'
  Expression form not supported.
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Whitelist (Allowlist)? - TechTarget
A whitelist (allowlist) is a cybersecurity strategy that approves a list of email addresses, IP addresses, domain names or applications, while denying all ......
Read more >
The Problem With Whitelisting Your Domain - Helpdesk
Whitelisting is the process of placing a sender address or domain onto an approved/trustworthy list that enables email sent from that sender/domain to...
Read more >
Asp.net randomly stops obeying forms authentication whitelist
We noticed that the server would start ignoring the whitelist rules when it got too heavy under load. Not much load, maybe 40%...
Read more >
Whitelisting in Mimecast - Knowledge Base - KnowBe4
Select the Gateway | Policies menu item. Select Permitted Senders from the list of policies displayed. Select the New Policy button. Select the ......
Read more >
Whitelisting Withdrawal Addresses - FTX Exchange
Tag issue - Please make sure the tag supplied when withdrawing is exactly the same as what you saved. The most common one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found