Group Group Group Group Group Group Group Group Group

Chapter 23 Github Authentication

Hey folks,

I implemented the google login fine and when I was implementing the Github login, the first time I tried to login with Github I was sent to the Github login screen, entered my creds and was sent to the authorization page, clicked the button to authorize the TIL app and was thrown an error there.

I logged out and logged in with google again, and was logged in correctly. Then I logged out of the TIL app and tried to login with Github again. I was immediately thrown an error and the url was http://localhost:8080/oauth/github?code=07130fd5465dfbcfec22
Is this possible a token issue or session issue? The second login with google brings me right into the home screen, but subsequent attempts to login with Github seems to throw errors immediately.

I’m using the Chrome browser in incognito mode because safari seems to force connections to localhost through https for some reason.

The TIL Server app seems to also be throwing multiple errors after the GitHub login attempts

**Server starting on http://localhost:8080**

**[ ERROR ] Abort.404: Not Found (ApplicationResponder.swift:50)**

**2019-04-11 15:59:19.362871-0700 Run[10022:141943] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=10022**

**2019-04-11 15:59:19.362960-0700 Run[10022:141943] SecTaskCopyDebugDescription: Run[10022]/0#-1 LF=0**

**[ ERROR ] Abort.404: Not Found (ApplicationResponder.swift:50)**

**[ ERROR ] Abort.404: Not Found (ApplicationResponder.swift:50)**

**2019-04-11 16:01:20.220707-0700 Run[10022:143790] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x101d24090] get output frames failed, state 8196**

**2019-04-11 16:01:20.220745-0700 Run[10022:143790] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x101d24090] get output frames failed, state 8196**

**2019-04-11 16:01:20.220880-0700 Run[10022:143790] TIC Read Status [1:0x0]: 1:57**

**2019-04-11 16:01:20.220889-0700 Run[10022:143790] TIC Read Status [1:0x0]: 1:57**

**2019-04-11 16:01:42.432617-0700 Run[10022:144091] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x104d2ec80] get output frames failed, state 8196**

**2019-04-11 16:01:42.432655-0700 Run[10022:144091] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C2.1:2][0x104d2ec80] get output frames failed, state 8196**

**2019-04-11 16:01:42.432784-0700 Run[10022:144091] TIC Read Status [2:0x0]: 1:57**

**2019-04-11 16:01:42.432793-0700 Run[10022:144091] TIC Read Status [2:0x0]: 1:57**

the actual error seems to be

**[ ERROR ] DecodingError.valueNotFound: Value of type 'String' required for key 'name'. (ErrorMiddleware.swift:26)**

Is the response from Github not in the manner we are expecting here? or do I need to do some update on Imperial? Where can I check what response to expect from the GitHub api?

It’s possible it’s a bug in Imperial because you’re already logged in, I’ll take a look. But definitely make sure you’re on the latest versions of everything with swift package update