How to implement OpenID in angular 4

I am creating an app with Angular 4 that I want to integrate with steam.

I am currently trying to wrap my head around openID and how to use it to get the 64 bit steam user id. This is bad. I found the typescript lib on the openID site and installed it in my application, but steam said I need to install http://steamcommunity.com/openid

as a provider.

After looking closely at the documentation for the Angular 4 OpenID lib, I can't seem to find a "provider" anywhere in D:

Again, I'm not even sure I'm using the correct library! (OpenID mentions "legacy specs like OpenID 2", which I'm sure is what steam uses)

Can someone help me wrap my head around this or point me to a simpler API for password access with OpenID?

Thank.

EDIT

Here is the code for config where I realized I didn't understand that I was doing more xD

export class AppModule {
constructor(public oidcSecurityService: OidcSecurityService) {

    let openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
    openIDImplicitFlowConfiguration.stsServer = 'https://localhost:44318';
    openIDImplicitFlowConfiguration.redirect_url = 'https://localhost:44311';
    openIDImplicitFlowConfiguration.client_id = 'angularclient';
    openIDImplicitFlowConfiguration.response_type = 'id_token token';
    openIDImplicitFlowConfiguration.scope = 'openid email profile';
    openIDImplicitFlowConfiguration.post_logout_redirect_uri = 'https://localhost:44311/Unauthorized';
    openIDImplicitFlowConfiguration.startup_route = '/home';
    openIDImplicitFlowConfiguration.forbidden_route = '/Forbidden';
    openIDImplicitFlowConfiguration.unauthorized_route = '/Unauthorized';
    openIDImplicitFlowConfiguration.log_console_warning_active = true;
    openIDImplicitFlowConfiguration.log_console_debug_active = false;
    openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = 10;
    openIDImplicitFlowConfiguration.override_well_known_configuration = false;
    openIDImplicitFlowConfiguration.override_well_known_configuration_url = 'https://localhost:44386/wellknownconfiguration.json';
    // openIDImplicitFlowConfiguration.storage = localStorage;

    this.oidcSecurityService.setupModule(openIDImplicitFlowConfiguration);
}

      

+3


source to share


1 answer


You don't even put the code in the correct file or against the correct app.component.ts class ie the AppComponent should contain this stuff.



You should download zip or better use Git and check it out from https://github.com/manfredsteyer/angular2-oauth-oidc-demo.git

+2


source







All Articles