Identity Server Google身份验证返回主目录/错误,但用户仍通过身份验证

时间:2019-11-25 17:48:27

标签: .net-core identityserver4 google-authentication

我需要帮助来了解错误日志并跟踪问题。

我有一个带Identity Server 4的.Net Core Angular,直接从模板中获取。我设置了Google Auth,它工作正常。现在,返回重定向URL使用home/error查询字符串将我转储到errorId。我可以想象一个错误会阻止身份验证,但是当我刷新页面时仍然可以通过身份验证。以下是两个日志。我试图清除噪音,因为它们每次都会排出几次。

登录时-错误

IdentityServer4.Validation.AuthorizeRequestValidator: Error: Unknown client or not enabled: myapp
{
  "SubjectId": "ff27e0ee-8070-4d05-98b7-55eaadb1d104",
  "RequestedScopes": "",
  "Raw": {
    "client_id": "myapp",
    "redirect_uri": "https://localhost:5001/authentication/login-callback",
    "response_type": "code",
    "scope": "myappapi openid profile",
    "state": "d045145f57794bb09a461ee08767f62b",
    "code_challenge": "rjwtw-xufahhjc7ouo6bkdz1zzw31vje7yi6djdophg",
    "code_challenge_method": "s256",
    "response_mode": "query"
  }
}

IdentityServer4.Events.DefaultEventService: Information: {
  "Name": "Token Issued Failure",
  "Category": "Token",
  "EventType": "Failure",
  "Id": 2001,
  "ClientId": "myapp",
  "Endpoint": "Authorize",
  "SubjectId": "ff27e0ee-8070-4d05-98b7-55eaadb1d104",
  "Scopes": "",
  "Error": "unauthorized_client",
  "ErrorDescription": "Unknown client or client not enabled",
  "ActivityId": "0HLRHOM4FO67O:0000024F",
  "TimeStamp": "2019-11-25T17:28:18Z",
  "ProcessId": 14504,
  "LocalIpAddress": "::1:5001",
  "RemoteIpAddress": "::1"
}

Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2 GET https://localhost:5001/home/error?errorId=CfDJ8LfbmCs7E9pCqNs6Z_pszJErC5nnvKYEGedv3tlaO2dMCHAZ2yFA_7HSpS-lvo_KbpsRsIM3srn5J19IFarU-pr-dPFZ2U73d3-194QzZMqDSM0oYzSjGtFjIWQL4Y3OkdovjhH-ZWDK11IZEPi-QP4pBAemO8TDarir8B9DSA5wyv4QxzbbtNedtAwtNikSxD6wIPGtnytTmFoZkLmnNh0Ue15YXYvNPMoaTQcWpmFd_ZmBn5KKgucr4hNVZQdqdfM81kRKnMcYfu5LaaakZCQUHn1GuN6rkLl0YoV0GytFNUdbTRxIvQXXyS7XFAwxX0Wu1APrudLfLh9HD7kQ9jQxVJFOIKyrNaJ_u4dwsx_d  

当我刷新应用程序时-尽管出错仍通过身份验证

Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2 GET https://localhost:5001/connect/authorize?client_id=MyApp&redirect_uri=https%3A%2F%2Flocalhost%3A5001%2Fauthentication%2Flogin-callback&response_type=code&scope=MyApp%20openid%20profile&state=731ef061967243eab92d6de172924ec7&code_challenge=8qmR1hk11BKYp_v-V8-8H3UFJ2WUI2Bnm48Ks3uQsL8&code_challenge_method=S256&prompt=none&response_mode=query

IdentityServer4.Endpoints.AuthorizeEndpoint: Debug: ValidatedAuthorizeRequest
{
  "ClientId": "MyApp",
  "ClientName": "MyApp",
  "RedirectUri": "https://localhost:5001/authentication/login-callback",
  "AllowedRedirectUris": [
    "/authentication/login-callback"
  ],
  "SubjectId": "ff27e0ee-8070-4d05-98b7-55eaadb1d104",
  "ResponseType": "code",
  "ResponseMode": "query",
  "GrantType": "authorization_code",
  "RequestedScopes": "MyAppAPI openid profile",
  "State": "731ef061967243eab92d6de172924ec7",
  "PromptMode": "none",
  "SessionId": "anPUIOP_kAAqVCxGwrkgTA",
  "Raw": {
    "client_id": "MyApp",
    "redirect_uri": "https://localhost:5001/authentication/login-callback",
    "response_type": "code",
    "scope": "MyAppAPI openid profile",
    "state": "731ef061967243eab92d6de172924ec7",
    "code_challenge": "8qmR1hk11BKYp_v-V8-8H3UFJ2WUI2Bnm48Ks3uQsL8",
    "code_challenge_method": "S256",
    "prompt": "none",
    "response_mode": "query"
  }
}
IdentityServer4.Events.DefaultEventService: Information: {
  "Name": "Token Issued Success",
  "Category": "Token",
  "EventType": "Success",
  "Id": 2000,
  "ClientId": "MyApp",
  "ClientName": "MyApp",
  "RedirectUri": "https://localhost:5001/authentication/login-callback",
  "Endpoint": "Authorize",
  "SubjectId": "ff27e0ee-8070-4d05-98b7-55eaadb1d104",
  "Scopes": "openid profile MyAppAPI",
  "GrantType": "authorization_code",
  "Tokens": [
    {
      "TokenType": "code",
      "TokenValue": "****VnDI"
    }
  ],
  "ActivityId": "0HLRHOM4FO67O:00000275",
  "TimeStamp": "2019-11-25T17:28:24Z",
  "ProcessId": 14504,
  "LocalIpAddress": "::1:5001",
  "RemoteIpAddress": "::1"
}
IdentityServer4.Endpoints.AuthorizeEndpoint: Debug: Authorize endpoint response
{
  "SubjectId": "ff27e0ee-8070-4d05-98b7-55eaadb1d104",
  "ClientId": "MyApp",
  "RedirectUri": "https://localhost:5001/authentication/login-callback",
  "State": "731ef061967243eab92d6de172924ec7",
  "Scope": "openid profile MyAppAPI"
}

A)我不知道我怎么得到错误。 B)我不知道该如何通过错误进行身份验证

如有必要,我可以尝试提供更多日志

0 个答案:

没有答案
相关问题