question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tryLogin - without discovery document - failing

See original GitHub issue

Hello,

I try to implement the oidc without discovery document therefor i use the tryLogin - method:

private configureOIDC() { this.oauthService.configure(OIDCconfig); this.oauthService.tokenValidationHandler = new JwksValidationHandler(); this.oauthService.tryLogin(); }

This is my OIDC config:

export const OIDCconfig: AuthConfig = { issuer: 'https://xxxxxx.com/xxxx', redirectUri: 'https://xxxxxx.com/login', clientId: 'myclientID', scope: 'openid', responseType: 'token' }

When i call the tryLogin method nothing happens.

Am I missing something?

According to the docs this should be enough:

`
this.oauthService.loginUrl = “https://steyer-identity-server.azurewebsites.net/identity/connect/authorize”; //Id-Provider?

    // URL of the SPA to redirect the user to after login
    this.oauthService.redirectUri = window.location.origin + "/index.html";

    // The SPA's id. Register SPA with this id at the auth-server
    this.oauthService.clientId = "spa-demo";

    // set the scope for the permissions the client should request
    this.oauthService.scope = "openid profile email voucher";

    // Use setStorage to use sessionStorage or another implementation of the TS-type Storage
    // instead of localStorage
    this.oauthService.setStorage(sessionStorage);

    // To also enable single-sign-out set the url for your auth-server's logout-endpoint here
    this.oauthService.logoutUrl = "https://steyer-identity-server.azurewebsites.net/identity/connect/endsession";

    // This method just tries to parse the token(s) within the url when
    // the auth-server redirects the user back to the web-app
    // It doesn't send the user the the login page
    this.oauthService.tryLogin();

`

But obviously i get an error with this example code:

“Error in initImplicitFlow TypeError: Cannot read property ‘responseType’ of null”

Any help would be very appreciated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
mauflcommented, Jul 22, 2019

Try setting oidc: false and the loginUrl in the auth config.

1reaction
alexfromgalax87commented, Jun 25, 2019

Is there any working example for implicit flow without discovery documents?

The example https://github.com/manfredsteyer/angular-oauth2-oidc/blob/master/docs-src/implicit-flow-config-no-discovery.md obviously does not work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular-oidc library code flow without discovery document
Authorization code Legacy flow (without pkce) configure mannually without discovery document - manfredsteyer / angular-oauth2-oidc.
Read more >
Configure Library for Implicit Flow without discovery document
When you don't have a discovery document, you have to configure more properties manually: Please note that the following sample uses the original...
Read more >
angular-oauth2-oidc.cognito - npm package - Snyk
Otherwise, the validation of the user profile will fail! ... Configure Library for Implicit Flow (without discovery document).
Read more >
Implicit flow authentication using angular-oauth2-oidc (Angular)
When the AuthConfig properties has been set then configure the OAuthService for loadingidentity server's discovery document & if access ...
Read more >
angular-oauth2-oidc-cognito/README.MD - UNPKG
377, After tryLogin did its job, you can manually perform the initial ... 444, ### Configure Library for Password Flow (without discovery document)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found