Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Authentication #162

Closed
tride258 opened this issue Dec 8, 2021 · 4 comments
Closed

GitHub Authentication #162

tride258 opened this issue Dec 8, 2021 · 4 comments
Labels

Comments

@tride258
Copy link

tride258 commented Dec 8, 2021

Hello. I got an error when trying to authenticate via github.
I added client id client secret
github.com in Authorized domains
callback url: https://demoexm-ec418.firebaseapp.com/__/auth/handler
and created access token

Here is my code:

var authProvider = new FirebaseAuthProvider(new Firebase.Auth.FirebaseConfig("api"));
//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
var auth = await authProvider.SignInWithOAuthAsync(FirebaseAuthType.Github, "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");
firebaseClientAuth = new Firebase.Database.FirebaseClient(
                  "https://demoexm-ec418-default-rtdb.firebaseio.com/",
                  new FirebaseOptions
                  {
                      AuthTokenAsyncFactory = () => Task.FromResult(auth.FirebaseToken)
                  });```

I get this in response:

```Firebase.Auth.FirebaseAuthException: Exception occured while authenticating.
Url: https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key={0}
Request Data: {"postBody":"access_token=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&providerId=github.com","requestUri":"http://localhost","returnSecureToken":true}
Response: {
  "error": {
    "code": 400,
    "message": "INVALID_IDP_RESPONSE : Unsuccessful check authorization response from Github: {\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/reference/apps#check-a-token\"}",
    "errors": [
      {
        "message": "INVALID_IDP_RESPONSE : Unsuccessful check authorization response from Github: {\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/reference/apps#check-a-token\"}",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

Reason: Undefined ---> System.Net.Http.HttpRequestException: Код состояния ответа не указывает на успешное выполнение: 400 (Bad Request).
   в System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   в Firebase.Auth.FirebaseAuthProvider.<ExecuteWithPostContentAsync>d__43.MoveNext()
   --- Конец трассировки внутреннего стека исключений ---
   в Firebase.Auth.FirebaseAuthProvider.<ExecuteWithPostContentAsync>d__43.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в Firebase.Auth.FirebaseAuthProvider.<SignInWithOAuthAsync>d__19.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   в FireBaseCore.Core.<RegisterUserByGitHubAsync>d__8.MoveNext() в D:\FireBaseCore\FireBaseCore\Core.cs:строка 104
False
FireBaseCore.Post[]```
@tride258
Copy link
Author

identitytoolkit googleapis is no longer supported and all authentication methods except mail + password do not work

@stale
Copy link

stale bot commented Jul 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 11, 2022
@stale
Copy link

stale bot commented Aug 13, 2022

Closing the issue due to inactivity. Feel free to re-open

@stale stale bot closed this as completed Aug 13, 2022
@chadrockey
Copy link

May also be related to #227 but I see you have an access_token in the body which is further than Apple gets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants