Skip to content

added requestIdToken#10

Open
nowfalsalahudeen wants to merge 4 commits intoiFanie:masterfrom
nowfalsalahudeen:master
Open

added requestIdToken#10
nowfalsalahudeen wants to merge 4 commits intoiFanie:masterfrom
nowfalsalahudeen:master

Conversation

@nowfalsalahudeen
Copy link
Copy Markdown

@nowfalsalahudeen nowfalsalahudeen commented Jan 3, 2019

added requestIdToken on google oAuth client for backent google authentication

<meta-data
            android:name="google_server_client_id"
            android:value="value />

need to add this in your project manifest
@iFanie
Copy link
Copy Markdown
Owner

iFanie commented Jan 3, 2019

@nowfalsalahudeen looks very good, but I'll make some comments about a few changes to make your code more aligned with the rest. Also, could you change the base branch from master to develop? After merging I'll make a release for the master branch.

@iFanie iFanie self-requested a review January 3, 2019 19:11
}
}
```
add google_cerver_client meta-data in application tag on your manifest file to get idToken for backend authentication
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Right above this line, you can see the manifest placeholders I have created for any values that need to be in the manifest. With this google_server_client_id, we should take the same approach, both for ease of use and consistency.

android:value="${twitter_api_secret}" />

See the above placeholder and follow the same approach. After that, the end user would just need to add another placeholder in their build file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yep. thats nice


) : RoguinEndpoint {

private var myApiKey: String? = null
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You should remove this as it is only used internally in the initialization of the googleClient. A local variable is sufficient.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

coz the local variable not accessibleout site try-catch block. thats y i declared that in globally

val bundle = ai.metaData
myApiKey = bundle.getString("google_server_client_id")
} catch (e: Exception) {
Log.e(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You should wrap this log around a safe block for debug builds, like it is done on the TwitterEndpoint.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yep.will follow the same method as your code


val options = GoogleSignInOptions
.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(myApiKey)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Will this cause a problem on NULL apiKeys?

Copy link
Copy Markdown
Owner

@iFanie iFanie left a comment

Choose a reason for hiding this comment

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

This is good solution that escaped my initial implementation. After we resolve the comments I added, it will definitely be included in the next release.

@nowfalsalahudeen
Copy link
Copy Markdown
Author

@nowfalsalahudeen looks very good, but I'll make some comments about a few changes to make your code more aligned with the rest. Also, could you change the base branch from master to develop? After merging I'll make a release for the master branch.

yep will try to change soon. But the problem is am the very first to use pull request and branching mechanism of github.Iam a gitlab user. I have only very basic idea. will try to learn and something do more

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants