Skip to content
This repository was archived by the owner on Dec 18, 2019. It is now read-only.

Sync auth#403

Merged
wtrocki merged 5 commits intosyncfrom
sync-auth
Sep 5, 2018
Merged

Sync auth#403
wtrocki merged 5 commits intosyncfrom
sync-auth

Conversation

@wtrocki
Copy link
Copy Markdown
Contributor

@wtrocki wtrocki commented Aug 30, 2018

Posting for early visibility.

@wtrocki wtrocki requested review from jhellar and psturc August 30, 2018 10:02
@wtrocki wtrocki changed the base branch from master to sync August 30, 2018 10:19
@wtrocki wtrocki requested a review from darahayes August 30, 2018 10:19
@wtrocki wtrocki mentioned this pull request Aug 31, 2018
[id='{context}_authentication']
= Authentication

The {sync-service} by default do not provide any any authentication and authorization mechanism.
Copy link
Copy Markdown
Contributor Author

@wtrocki wtrocki Aug 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psturc Actually tried to execute this steps and see how long this takes. It's not simple or convenient which made me question entire instruction. pinged @ziccardi to see if we can just get config directly from keycloak server and paste that directly as content to environment variable. If this is working we can document that - possibly instruction will change to 3 simple steps, but it will not include binding.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that sounds good

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be separate ticket as @ziccardi is out sick.

@wtrocki
Copy link
Copy Markdown
Contributor Author

wtrocki commented Sep 4, 2018

Can we check this again? It's still pretty raw (we can improve it later).
If we merge that we going to unblock @darahayes PR that may be related to this.

Copy link
Copy Markdown
Contributor

@darahayes darahayes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @wtrocki apologies for the very specific review. It's all minor grammar things but they're important to get right.

[id='{context}_authentication']
= Authentication

The {sync-service} by default do not provide any any authentication and authorization mechanism.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps rework this to the following:

By default, {sync-service} does not provide any authentication and authorization mechanism.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Dara's rewording

* Ensure {keycloak-service} is xref:keycloak/provisioning.adoc[provisioned]
* Ensure {keycloak-service} is xref:keycloak/coding.adoc[configured] to work with your mobile applications

== Binding the {sync-service} service to a {keycloak-service} instance
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice is to captialize headings, except for words like is, a, the, to etc.

Should be:

Binding the {sync-service} Instance to a {keycloak-service} Instance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, there's a debate about that style issue, Dara describes the style called Titlecase, more likely we're going with Sentence case, which is what is there currently


== Binding the {sync-service} service to a {keycloak-service} instance

To benefit from authentication developers need to connect (bind) {sync-service} into {keycloak-service} instance.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar thing:

To benefit from authentication, developers...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To implement authentication in your app, you must bind the {sync-service} service with the {keycloak-service} service.


NOTE: The mount path must be set to `/opt/keycloak` for the {sync-service} to be configured to use the secret.

== Making secret available
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, capitalization. Should probably be:

Making the Secret Available

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1


== Making secret available

By default secret is not visible to server application
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar thing. Should probably be like this:

By default, the secret is not visible to the server application

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

== Making secret available

By default secret is not visible to server application
To point server to application please add new environment variable:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again just some small grammar stuff,

To point the server to the application, please add a new environment variable:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jhellar
Copy link
Copy Markdown
Contributor

jhellar commented Sep 4, 2018

The Authentication section is now in Setting up section. Shouldn't it be in it's own section similarly to Monitoring Data Sync Service section?

@jhellar
Copy link
Copy Markdown
Contributor

jhellar commented Sep 4, 2018

After completing the steps, and opening data sync server url on /graphql endpoint, I get Invalid parameter: redirect_uri. Should we also add steps for configuring valid redirect uri?

@jhellar
Copy link
Copy Markdown
Contributor

jhellar commented Sep 4, 2018

Will this work with self-signed certs? Should we document it?

@psturc
Copy link
Copy Markdown
Contributor

psturc commented Sep 4, 2018

The trick for getting this working with self-signed certs is to add NODE_TLS_REJECT_UNAUTHORIZED = 0 to environment variables in the data-sync-server deployment config. This should be documented.

include::{partialsdir}/attributes.adoc[]

= Using the {sync-service} service SDK
= Using the {sync-service} SDK
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the way we refer to SDK in doc, but will fix in post

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah.. Really sorry. Missing tons of context here.

@wtrocki
Copy link
Copy Markdown
Contributor Author

wtrocki commented Sep 5, 2018

Let's create another ticket to review entire auth docs:

The Authentication section is now in Setting up section. Shouldn't it be in it's own section similarly to Monitoring Data Sync Service section?

After completing the steps, and opening data sync server url on /graphql endpoint, I get Invalid parameter: redirect_uri. Should we also add steps for configuring valid redirect uri?

This is part of the prerequisites (Keycloak setup and running) instruction there explains it and I did not want to copy the content here.

Will this work with self-signed certs? Should we document it?

This is canonical documentation ( we will need to get some local machine documentation that will cover self signed certs.

@wtrocki
Copy link
Copy Markdown
Contributor Author

wtrocki commented Sep 5, 2018

@jhellar @psturc Can you take look and get that very raw version of this. Can we get some consensu how to reorganize this content better, basing on your valuable feedback.

@wtrocki wtrocki force-pushed the sync-auth branch 2 times, most recently from 7f4b5ae to a3fc127 Compare September 5, 2018 09:58
@wtrocki
Copy link
Copy Markdown
Contributor Author

wtrocki commented Sep 5, 2018

@darahayes Final review?

@wtrocki
Copy link
Copy Markdown
Contributor Author

wtrocki commented Sep 5, 2018

Mering to sync branch in order to rebuild, joing articles together

@wtrocki wtrocki merged commit e606ce2 into sync Sep 5, 2018
@wtrocki wtrocki deleted the sync-auth branch September 5, 2018 10:39
o point the server to the application, please add a new environment variable:

----
KEYCLOAK_CONFIG_FILE= `/opt/keycloak`TODO
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we leaving this as is? we could change it to the actual value we are using for now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups. yeah. TODO needs to be removed. I overlooked that in the rush

@StephenCoady
Copy link
Copy Markdown
Member

StephenCoady commented Sep 5, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants