Setting up auth flow for mobile app

So how do i do this?
I tried a few things and i can get to the server and auth with github, but when it redirects it gives me an error or makes the user still register using the form.

  1. how do i register a user completely trough a 3rd party and redirect them right back to my app, no further forms (one press register basically)
  2. is there a way to handle registration and login directly from my app without going trough the webpage?