![]() It takes some getting used to, but know that, as long as the user is logged into Google, your app doesn't need to worry about whether or not the user is who he/she says he/she is. That's the whole point! It authenticates against Google so the user doesn't have to enter his or her password over and over and over again in each web application he or she uses. What's important for you to keep in mind is that, when you logout of your app, you don't need to make the user re-enter a password. Note that this does not necessarily mean the user will be logged out of your application, only Google. If you redirect your user to the logout page, or invoke it from an element that isn't cross-domain restricted, the user will be logged out of Google. With that said, if you still do want to log a user out of Google, and realize that you may very well be disrupting their workflow, you could dynamically build the logout url from one of their Google services logout button, and then invoke that using an img element or a script tag: Yeh yeh, whatever, I still want to log the user out Of Google, just tell me how do I do this? In short, you really don't want to do this. Think about it like this: As a user, how annoyed do you think I would be if I logged into 5 different services with my Google account, then the first time I logged out of one of them, I have to login to my Gmail account again because that app developer decided that, when I log out of his application, I should also be logged out of Google? That's going to get old really fast. With that said, what you're asking to do is log the user out of a service that really doesn't belong to you. Once your app knows who the user is, that person can log out of Google. In fact, I can log out of all of my Google accounts and still be logged into Stack Overflow. When your user logs out, he or she isn't logging out of Google, he/she is logging out of your app, or Stack Overflow, or Assembla, or whatever web application used Google OAuth to authenticate the user. Google and Stack Overflow, Assembla, Vinesh's-very-cool-slick-webapp, are all different entities, and Google knows nothing about your account on Vinesh's cool webapp, and vice versa, aside from what's exposed via the API you're using to access profile information. Here's where developers new to OAuth sometimes get a little confused. When you logout of your app, you're logging out of your app: When you enter your Google password, Google then tells Stack Overflow you are who you say you are, and Stack Overflow logs you in. "Hang on a sec Stack Overflow, I'll authenticate this fella and if he can enter the right password for his Google account, then it's him". ![]() If you're logged in already, Google will say YES. "Yo Google, this Vinesh fella claims that is him, is that true?" I'm not sure if you used OAuth to login to Stack Overflow, like the "Login with Google" option, but when you use this feature, Stack Overflow is simply asking Google if it knows who you are: Namespace of OAuth: Is the User Who He/She Says He/She is?: Return !string.IsNullOrWhiteSpace(Token) You can create a username from a portable library and refer to the code below. If you want to retrieve and save user information. Public partial class SecuredLoginPage: ContentPage The following code is for Xamarin.Forms Dependency service that maps the provider login page to a login renders. We need to add a Login page render that will be used by Xamarin.Auth to display the web view for the OAuth log-in page. Thus, you need to create a specific login page (loginRenderer. We need to create a platform-specific LoginRenderer Page.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |