There are several sample that build on each other, adding new features at every step:
Simple: A very basic static app with only a home page and unconditional login
Click: Adds an explicit link that the user has to click to log in.
Sign Out: Adds a sign out link for authenticated users as well.
Two Providers: Adds a second login provider so that the user can choose on the main page which one to use.
Custom Error: Adds an error message for unauthenticated users and custom authentication that depends on the GitHub API.
Note:
Every application can be imported into the IDE.
All applications run on localhost:8080 because they will use OAuth 2.0 clients registered with GitHub and Google for that address.
For more details Resources