Need option to add custom scopes to every individual providers like in example below
https://firebase.google.com/docs/auth/web/github-auth#handle_the_sign-in_flow_with_the_firebase_sdk
provider.addScope('repo');
Hi vinothkannans,
This feature is on our roadmap, we'll update this thread when it is released.
Thomas
Hi TMCH, Thanks for including this feature.
Eagerly waiting...
any idea by when you folks plan to release this.
Or may you put the firebase-ui-auth.js library source to github so we can provide PR of this feature?
@edvail Infact I 'beautified' the minified firebase-ui.auth.js and firebase.js in chrome dev tools and started debugging to explore how the
Here is my observation, if you can take it from here:
(Only Google and Facebook have provision for oAuth2 scopes, Twitter doesn't have, as far as my understanding)
uiconfig variable, in such a way that script is able to provide scope as configurable option for following piece of script (PS: c should be array type before exiting) :Zi = function(a, b) {
var c = a.config_.get("idpConfig") || {};
return xh(b) && c[b] ? (c = c[b].scopes || null ,
fa(c) ? c : []) : []
}Ej = function(a, b, c) {
var d = wh[c] && firebase.auth[wh[c]] ? new firebase.auth[wh[c]] : null ;
c = Zi(a.config_, c); /*CommentStart a.config_ is FirebaseUi Config defined in var uiconfig, c is individual PROVIDER_ID, proxy for google.com, facebook.com etc. CommentEnd*/
if (d && d.addScope)
for (var e = 0; e < c.length; e++)
d.addScope(c[e]);}
I wonder, Firebase webui team even after coming this close has not implemented the feature of adding scope, possibly because they might be wondering for other possible identity provider configurations (apart from'scope') and most efficient way to implement 'idpConfig' without repeating the provider_id in two places (one already in 'signInOptions')
@TMSCH certainly wondering for the library source if you can point out...
Hi @jalajc,
This new feature has just been released. See the doc: https://github.com/firebase/firebaseui-web#custom-scopes
@TMSCH Thanks:+1:
but you have literally taken back the thrill from me,,, I have kind of work around implemented a day back for 0.4 version as this as I didn't find it earlier in 0.5.0 milestone. Notice that added idpConfig in uiconfig
'signInOptions': [
// TODO(developer): Remove the providers you don't need for your app.
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
],
'idpConfig':
{
'google.com':
{'scopes':['https://www.googleapis.com/auth/fitness.location.read', 'https://www.google.com/m8/feeds']
}
,
'facebook.com':
{'scopes':[<space separated scopes>]
}
},
Nevertheless, official it comes, better I feel!
This won't work anymore in release 0.5.0, so I recommend to use the updated configuration parameter ;)
@TMSCH , is it possible to define scope with Firebase email sign?
You mean, password sign in? scopes are only relevant to OAuth sign in. So it does not apply to password sign in.
@bojeil-google , i will reformulate the question. How to create a Firebase email sign-in with Authorization embeded into the token?
Are you trying to set custom attributes to the token? If so, this is not supported in FirebaseUI (not for any provider except for custom auth sign in). You probably need to go to the Firebase forum: https://groups.google.com/forum/#!forum/firebase-talk
And file a feature request.
One thing you can do is after sign in, mint a custom token with custom attributes for the same user ID and re-sign in that user with that custom token via signInWithCustomToken. The token will contain the additional attributes.
Most helpful comment
Hi vinothkannans,
This feature is on our roadmap, we'll update this thread when it is released.
Thomas