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

Write Docs & Publish Package in Hex.pm #10

Closed
5 tasks done
nelsonic opened this issue Nov 25, 2019 · 13 comments
Closed
5 tasks done

Write Docs & Publish Package in Hex.pm #10

nelsonic opened this issue Nov 25, 2019 · 13 comments
Assignees
Labels
awaiting-review documentation Improvements or additions to documentation enhancement New feature or request epic T1d T2h

Comments

@nelsonic
Copy link
Member

nelsonic commented Nov 25, 2019

This project is almost ready to ship.
There are a few issues open to discuss but we can already use it in our app.
In order to do that we should:

image

![Hex.pm](https://img.shields.io/hexpm/v/elixir_auth_google?color=brightgreen&style=flat-square)

Hex.pm

@nelsonic nelsonic added documentation Improvements or additions to documentation enhancement New feature or request T2h labels Nov 25, 2019
@nelsonic
Copy link
Member Author

I've spent the evening re-reading Google OAuth docs and writing #11 ... 📝
I have 15 screenshots to annotate and write up the instructions. 🖼
going to continue working on it tomorrow morning. 😪

@nelsonic
Copy link
Member Author

When setting up a New Project so that we can use Google OAuth we see the following screen
informing us that "You don’t have any APIs available to use yet. To get started, click “Enable APIs and services” or go to the API library":

elixir-auth-demo-enable-apis

Clicking on the (ALL CAPS) + ENABLE APIS AND SERVICES button takes us to the API landing page.
263 APIs and no "most popular/used" to help a beginner filter for what they are looking for ...
image

Is Google Maps API really the one that should be at the top?
Maybe it is the most popular Google Service that devs integrate with ... 💭

Why is this still available without a deprecation warning?! Come on Google! 😞
image

Searching for auth returns 6 results; none of which are relevant to Google Auth ...
image

The last one "Identity and Access Management (IAM) API" looks like it could be relevant ...
image

But it's actually for managing the users of Google Cloud Platform (GCP) and nothing to do with letting people authenticate with their Google Account ... 🤦‍♂

I get the feeling this is a red herring ... https://en.wikipedia.org/wiki/Red_herring

@SimonLab
Copy link
Member

@nelsonic I was also confused on the APIs section, especially that at the moment we only want to get the basic user information and seems overkilling to enable an API for that. I manage to find the endpoint to get this information (see #9) after finding a similar issue on the nodejs google client repo: googleapis/google-api-nodejs-client#1529

The endpoint https://www.googleapis.com/oauth2/v3/userinfo?access_token=... works without the need to enable any API but I was surprised to not be able to find a short documentation describing how to get this user profile information.

@nelsonic
Copy link
Member Author

Select Credentials from the left side menu:
elixir-auth-google-click-credentials-menu

Once in the credentials menu, click the Create Credentials button:
Screenshot 2019-11-26 at 23 24 28
That will popup a menu from which you will select OAuth Client ID.

First set a product name ... Configure consent screen ...
elixir-auth-google-create-client-id-first-select-name

Why didn't they just have a logically flowing "wizard" that goes through the steps in the right order?!

@nelsonic
Copy link
Member Author

The order it should be done in:


After creating the New Project,
the UI will return to the APIs dashboard
and the name of your app will appear in the top menu.

Click the OAuth Consent Screen from the left side menu:

elixir-auth-google-consent-screen

Upload an image if you have one (e.g: the icon/logo for your app):

OAuth-consent-screen-1of2

Scroll down to the bottom and click "Save":
OAuth-consent-screen-2of2

This will take you to the API Credentials page.
Click the Create Credentials button:
Screenshot 2019-11-26 at 23 24 28
That will popup a menu from which you will select OAuth Client ID.

@SimonLab
Copy link
Member

@nelsonic when adding the redirect url, don't foget to use the enter key otherwise the url won't be saved. This one is quiet bad and you could spend a lot of time trying to figure out what's going on.
see #2 (comment)

@nelsonic
Copy link
Member Author

@SimonLab noted. Thanks for the reminder.
I think it saved first time for me, but it's worth informing others in the docs. 👍

elixir-auth-google-oauth-client-credentials

⚠️ Don't worry, these keys aren't valid (anymore).
We deleted them immediately after capturing the screenshot to avoid any security issues.
Obviously treat your credentials like you would the username+password for your bank account;
never share a real Client ID or secret on GitHub or any other public/insecure forum!

@nelsonic
Copy link
Member Author

I've added all the @doc comments to the code so hex docs can be produced. ✅
I still need to finish documenting how to setup an app and linking to sample code.
But I was thinking of publishing a pre 1.0 version to Hex.pm just so that we can run it in the MVP.
Any objections?

@nelsonic nelsonic self-assigned this Nov 29, 2019
@nelsonic
Copy link
Member Author

Docs:

image

I feel these docs are adequate for our purposes now. We will be supplementing them with more extensive code samples (links to actual code in our MVP App) shortly. 👍

@nelsonic
Copy link
Member Author

Published alpha version to use in MVP: (The fruits of @SimonLab's hard work!) 🎉
https://hex.pm/packages/elixir_auth_google/0.0.1
https://hexdocs.pm/elixir_auth_google/0.0.1

Will finish/update docs with code samples and re-publish 1.0 version shortly. ⏳

@nelsonic nelsonic added the epic label Nov 30, 2019
@nelsonic
Copy link
Member Author

I'm busy refining the Docs of this package by working on the Auth PR: dwyl/mvp#24
Once that is done we will have sample code that we can include here.

continue: #11

@nelsonic
Copy link
Member Author

nelsonic commented Dec 5, 2019

Demo version shipped to Heroku: https://elixir-auth-google-demo.herokuapp.com
image

Docs complete!

@nelsonic
Copy link
Member Author

nelsonic commented Dec 7, 2019

https://hex.pm/packages/elixir_auth_google done. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review documentation Improvements or additions to documentation enhancement New feature or request epic T1d T2h
Projects
None yet
Development

No branches or pull requests

2 participants