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