Hi All, Self sign-up handles within SSO app on our side not through the store or publisher. Above approach will work if we are to use the OOTB provided setup(store/publishred SSOed with sso app). But will break once configured with an external IDP.
Regards, UdaraR On Tue, Jul 21, 2015 at 6:49 AM, Lalaji Sureshika <lal...@wso2.com> wrote: > Hi Sameera, > > On Jul 20, 2015 9:32 PM, "Sameera Medagammaddegedara" <samee...@wso2.com> > wrote: > > > > Hi Lakshman, > > > > > > Could we not do this in the onUserLoggedIn callback itself after > checking if the logged in user already has the subscriber role or not? > > We can't use this approach,because then for any user tries to login to > store,we are setting the subscriber role,which is incorrect.. > Shouldn't all store sign-up users have the subscriber role? Can there be store logged-in users without having the subscriber role? > What we want is setting the subscriber role for store sign-up users.Isn't > there a sign-up hook available as for login..? > > Thanks: > > > > > > > Thank You, > > Sameera > > > > On Mon, Jul 20, 2015 at 6:10 AM, Lakshman Udayakantha < > lakshm...@wso2.com> wrote: > >> > >> Couldn't add onLogin function is used in extension in previous mail. > sorry for that. find it below. > >> > >> onUserLoggedIn : function(){ > >> var userName=ctx.username; > >> var apistore = > require('apistore').apistore.instance(userName); > >> var subscriber=apistore.getSubscriber(userName); > >> if(!subscriber){ > >> apistore.addSubscriber(userName,ctx.tenantId); > >> } > >> }, > >> > >> additionally, found below function > >> > >> event.on('userRegister', function (tenantId, user) { > >> log.info("user > registering..................................."); > >> configs(tenantId).userRoles.forEach(function (role) { > >> if (user.hasRoles([role])) { > >> return; > >> } > >> user.addRoles([role]); > >> }); > >> }); > >> > >> It should be call on user signup. But it calls on first login for the > users who signed up. Any way I can't change that function to add subscriber > role to users because this function found in store/module/store.js file > which is not in extension directory. simply this function reside in ES code > and adding subscriber role to users should happen in extension because that > functionality is specific to API store. > >> > >> Thanks > >> > >> On Mon, Jul 20, 2015 at 3:05 PM, Lakshman Udayakantha < > lakshm...@wso2.com> wrote: > >>> > >>> Hi Sameera/ES Team, > >>> > >>> I am working on [1]. I want to add to users who sign up in store, the > subscriber role. > >>> Below function is used to add users as subscribers in their first > login to subscriber tables in asset.js function in store extension. similar > requirement needs for signup as well. how do I achieve this? > >>> > >>> [1] https://wso2.org/jira/browse/REGISTRY-2683 > >>> > >>> Thanks > >>> -- > >>> Lakshman Udayakantha > >>> WSO2 Inc. www.wso2.com > >>> lean.enterprise.middleware > >>> Mobile: 0711241005 > >>> > >> > >> > >> > >> -- > >> Lakshman Udayakantha > >> WSO2 Inc. www.wso2.com > >> lean.enterprise.middleware > >> Mobile: 0711241005 > >> > > > > > > > > -- > > Sameera Medagammaddegedara > > Software Engineer > > > > Contact: > > Email: samee...@wso2.com > > Mobile: + 94 077 255 3005 > >
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev