Authenticate Angular with Steam

1

I'm trying to authenticate my Angular app with Steam, but this is generating this error in the log:

Failed to load http://steamcommunity.com/openid/.well-known/openid-configuration: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

The error occurs when building the component, when clicking on login, it does not generate any errors, however it is not redirected to the Steam login screen.

My source code:

  constructor(private oauthService: OAuthService) {
    this.oauthService.redirectUri = window.location.origin + '/index.html';
    this.oauthService.clientId = 'spa-demo';
    this.oauthService.scope = 'openid profile email voucher';
    this.oauthService.oidc = true;
    this.oauthService.setStorage(sessionStorage);
    this.oauthService.issuer = 'http://steamcommunity.com/openid';
    this.oauthService.requireHttps = false;
    this.oauthService.dummyClientSecret = 'geheim';

    this.oauthService.loadDiscoveryDocument().then(() => {
      this.oauthService.tryLogin({});
    });
  }

  public login(): void {
    this.oauthService.clientId = 'spa-demo';
    this.oauthService.initImplicitFlow();
  }

I'm using Angular 5.

Steam OpenID provider documentation: link

    
asked by anonymous 25.01.2018 / 18:01

1 answer

1

Try to disable your firewall, if it does not work try to run on another machine or a professional hosting.

It can be Xampp or Wamp too

    
25.01.2018 / 18:36