title: Cannot redirect back to angular client after login in identity server
body: <p>I've got an issue with redirecting after loggin in with identity server.</p>
  <p>I have the following angular-auth-oidc-client config:</p>
  <pre><code>    export function configureAuth(oidcConfigService: OidcConfigService) {
    return () =&gt;
      oidcConfigService.withConfig({
        stsServer: 'http://localhost:5002',
        redirectUrl: window.location.origin,
        postLogoutRedirectUri: window.location.origin,
        clientId: 'applications-portal',
        scope: 'openid profile',
        responseType: 'id_token token',
        logLevel: LogLevel.Debug,
      });
  }
  </code></pre>
  <p>And app.component.ts:</p>
  <pre><code>  ngOnInit() {
      this.oidcSecurityService.checkAuth().subscribe((auth) =&gt; {
        console.log('is authenticated', auth);
        if (!auth) {
          this.login();
        }
      });
    }
  
    login() {
      this.oidcSecurityService.authorize();
    }
  </code></pre>
  <p>This is the client configuration in the identity server app:</p>
  <pre><code>new Client
                  {
                      ClientId = &quot;applications-portal&quot;,
                      ClientName = &quot;Applications Portal&quot;,
                      AllowedGrantTypes = GrantTypes.Implicit,
                      AllowedScopes =
                      {
                          &quot;service&quot;,
                          IdentityServerConstants.StandardScopes.OpenId,
                          IdentityServerConstants.StandardScopes.Profile
                      },
                      AccessTokenType = AccessTokenType.Jwt,
                      AllowAccessTokensViaBrowser = true,
                      RequireConsent = false,
                      RequireClientSecret = false,
                      RequirePkce = true,
                      RedirectUris = {
                          &quot;http://localhost:4200&quot;,
                      },
                      PostLogoutRedirectUris =
                      {
                          &quot;http://localhost:4200&quot;
                      },
                      AllowedCorsOrigins =
                      {
                          &quot;http://localhost:4200&quot;
                      },
                  }
  </code></pre>
  <p>And StartUp.cs:</p>
  <pre><code>    services.ConfigureApplicationCookie(config =&gt;
      {
          config.Cookie.Name = &quot;Identity.Cookie&quot;;
          config.LoginPath = &quot;/Auth/Login&quot;;
      });
  </code></pre>
  <p>The problem is that when I get redirected to AuthController in Login (GET) method I get returnUrl that looks like this:
  <a href="https://i.stack.imgur.com/794kf.png" rel="nofollow noreferrer">returnUrl Value</a></p>
  <p>And after the login it does not redirect me back to the client app, but stays on the login page. I belive that there's something wrong with the returnUrl itself. I'm using IdentityServer for the first time, so I don't really know what to dig for.</p>
  <p><strong>UPDATED:</strong></p>
  <p>The problem is in Chrome browser. SameSite thing prevents it to redirect. I've tried the solution here <a href="https://www.thinktecture.com/en/identity/samesite/prepare-your-identityserver/" rel="nofollow noreferrer">https://www.thinktecture.com/en/identity/samesite/prepare-your-identityserver/</a>
  but it didn't work. In other browsers, it works as expected. Could you give me a hint what to do in this case with Chrome?</p>
  <p>I've also tried setting it to Lax but nothing changes.</p>
  <pre><code>            services.ConfigureApplicationCookie(config =&gt;
          {
              config.Cookie.Name = &quot;Identity.Cookie&quot;;
              config.LoginPath = &quot;/Auth/Login&quot;;
              config.Cookie.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.Lax;
          });
  </code></pre>