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
I tried to disable the firewall and run the app on a professional hosting, and the problem still persists.
– M. Guilherme Neves