feat: add additional scopes request
Feature for simple request adding/removing additional scopes already authorised user
addScopes
- [x] ts types
- [ ] Web
- [ ] Android
- [ ] iOS
- [ ] docs
removeScopes
- [x] ts types
- [ ] Web
- [ ] Android
- [ ] iOS
- [ ] docs
closes: #158
hi @joeflateau need you help with this, and is need sponsoring you work) separate function from https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/27f0111d1a03e5b22a4788376f0869ea7c55a215/ios/Plugin/Plugin.swift#L67-L73
@reslear agree it would be good to add the "addScope" function, but I don't believe that would close #158, they seem unrelated.
@joeflateau #158 is example, but in my case need get google contacts from address book
In my onboarding screen app, login with google is required, is i'm set scopes
['profile', 'email', 'openid', 'https://www.googleapis.com/auth/contacts.readonly']
most people don't share contacts and leave the app 😨
but if we logged in a user with default areas ['profile', 'email', 'openid'], and somewhere in the application we made an optional button to share contacts
async function getContacts() {
// TODO: maybe need add checkScopes ?
await GoogleAuth.addScopes([
'https://www.googleapis.com/auth/contacts.readonly'
])
const { result } = await gapi.client.people.people.connections.list({
'resourceName': 'people/me',
'personFields': 'names',
})
return result.connections.map((person) => person.names[0].displayName)
}
web https://developers.google.com/identity/sign-in/web/incremental-auth#step_2_request_additional_scopes
@hoi4 maybe you help for this?