Starts in:
0 DAY
22 HRS
52 MIN
6 SEC
Starts in:
0 D
22 H
52 M
6 S

Activities of "aszklarz"

Hello,

Code parameter deleted automatically by angular-oauth2-oidc library. This problem is not related to the code query parameter by the way.

Can you follow the steps below to fix this problem?

  • Save redirectUri to local storage before starting the authorization code flow login
      login() { 
        this.oAuthService.redirectUri = 'REDIRECT_URI'; 
        localStorage.setItem('AuthRedirectUri', 'REDIRECT_URI'); 
        this.authService.navigateToLogin(); 
      } 
    
  • Add the following provider to your AppModule's providers
    @NgModule({ 
      declarations: [AppComponent], 
      imports: [ 
        //imports 
      ], 
      providers: [ 
        APP_ROUTE_PROVIDER, 
        { 
          provide: APP_INITIALIZER, 
          multi: true, 
          useValue: () => { 
            const redirectUri = localStorage.getItem('AuthRedirectUri'); 
            if (redirectUri) { 
              environment.oAuthConfig.redirectUri = redirectUri; 
              localStorage.removeItem('AuthRedirectUri'); 
            } 
          }, 
        }, 
      ], 
      bootstrap: [AppComponent], 
    }) 
    export class AppModule {} 
    
    

Hey, Thanks for your reply, I try your code but it seems like your answer is not a point of my problem.

My goal is to get Access token and refresh token, that i can strore on backend and use it when need. Atm i have a button with href that send me to login page. In href I pass parameters that external api need to start code flow ( response_type, redirect_uri etc). This process works fine. I Log in to external API, a then it redirect me to Uri that I pass in redirect_uri parameter. This part works fine too. BUT when api redirect me to redirect_uri it concat it with "code" parameter. For example Redirect_uri I send with href parameter: http://localhost:4200/somePage Redirect that api made: http://localhost:4200/somePage?code=123

And the point is I want to read this "code" parameter. In ngOnInit I try to listen for it:

    this._route.queryParams.subscribe(params => {
      this.code = params['code'];
      console.log(this.code);
    })

But this code is never reached because something (probably angular-oauth2-oidc library or its implementation) redirect me to http://localhost:4200/somePage.

So the question is, how to read this code parameter?

Hello,

Code, state, and session_state query parameters used by angular-oauth2-oidc library. Please use another queryParameter.

Usage detail

Hi, atm I'm trying to get resource from allegro and amazon, both of them send me back "code" and "state". I don't think "use another queryParameter" is good solution, no one of them will change queryParams for me. Is there any other(maybe abp build in) method to make auhorization code flow, to recieve access + refresh token pair that i can store in db?

Even on yours https://commercial-demo.abp.io/file-management when I change address to https://commercial-demo.abp.io/file-management?code=123 It's redirect me to https://commercial-demo.abp.io/file-management again. Any sugestions?

Showing 1 to 3 of 3 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06