Authenticate Angular with Steam

Asked

Viewed 99 times

1

I am trying to authenticate my Angular app with Steam, but this 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 login, it does not generate any error, 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: https://steamcommunity.com/dev?l=portuguese

1 answer

1

Try to disable your firewall, if it doesn’t work try to run on another machine or a professional hosting.

It could be Xampp or Wamp too

  • I tried to disable the firewall and run the app on a professional hosting, and the problem still persists.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.