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.

whitelistedDomains as a promise

See original GitHub issue

Hi, is there any way to pass whitelistedDomains as a promise? The example bellow jwtOptionsFactory receives AppConfigService which returns the domain value. Just for the record, the service is provided as APP_INITIALIZER.

export function jwtOptionsFactory(appConfig: AppConfigService) {
  return {
    tokenGetter: TokenHelper.getToken,
    headerName: 'token',
    authScheme: '',
    whitelistedDomains: [appConfig.domain],
    blacklistedRoutes: []
  };
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:13

github_iconTop GitHub Comments

3reactions
JWesscommented, Sep 24, 2019

This feature is exactly what my app needs. My app is hosted on a node server that contains a relative endpoint, /configuration, which returns the location of our API, which lives on a different domain. This allows us to use a node environment variable on the node server to configure what API our app should make all its API calls to. As such, we don’t know what domain to whitelist until our APP_INITIALIZER makes the call to /configuration. For this reason, we need this feature…we need whitelistedDomains to support Promises and/or Observables.

3reactions
shad1wcommented, Jan 24, 2019

I’d like to know whether this is possible as well.

This would be extremely helpful for use cases where the URL for the application’s backend is dynamically configurable and needs to be retrieved from the application’s assets, for example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I restrict Outbound Mail to Whitelisted Domains only.
We are trying to create an environment where our team members/consultants will be allowed to email across to certain customers only.
Read more >
Angular6 angular-jwt not adding token to request headers
am using angular-jwt to intercept my requests and add the JWT token, but that doesn't seem to be happening. This is my angular...
Read more >
How to Do JWT Authentication with an Angular 6 SPA - Toptal
The whiteListedDomains option exists so you can restrict which domains the JWT gets sent to, so public APIs don't receive your JWT as...
Read more >
angular-jwt-async - npm Package Health Analysis - Snyk
Allows for async promises for whitelist and blacklist For more information ... that you want to make requests to by specifying a whitelistedDomains...
Read more >
More Security Using Domain Filtering
... and check it against the array of whitelisted domains for a given user/client. ... gi, '') === args.domain)) === -1) { return...
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