Using the Oauth Module for our custom login and page access.
Hi all, I am currently working on a mobile application that needs to allow the user to login with their facebook account. I found the Oauth module in the app store and it provided a great functional source to connect with facebook. However, for the requirements we need we need to modified it. So I am new to mobile and the facebook api functionality. Right now, what we are trying to do is when the user logs into our application via the facebook login. We want the user to be sent to his particular page based off his role, but it sends us to the homepage desktop form, if the user exists on our application. As well if the user doesn't exist on our application we want to send the user to the register from and fill out the rest of their data plus the data we have obtain from facebook and therefore save the user into our system. As of right now the Oauth module takes a user that doesn't exist in the application to an unauthorized page instead. We have modified the java code to grab the data we want and tested saving the data but we cannot figure out how to direct a user to the correct page depending on the scenario of having access to the application or not. Any advice? Has anybody tried to achieve this with this module? We were thinking maybe we could use deeplink to help us configure what page or microflow the user can be sent to? We appreciate any help. Thanks
What you could try is in the OAuthCallBack class after the resolveUser part, make sure that an anonymous session is created via the loginhelper class and redirect to the index3 page.
Then create a registration form that has anonymous access to fill out the registration via the home page options. From the registration page create the user and via a the urlredirection widget from the app store redirect to the index page allowing the user to login, or send a mail with a link to the app, depending on what you think is the best user experience.
Hope this helps you in the right direction.
Erwin 't Hoen
Thank you for the advice and the direction. I'm definitely not a java developer but I'm learning. I have been working on different pieces of the app and I have recently got back to the section and implemented what you described above. Here is the code I implemented in the LoginHelper function. However, I still came across an issue when it took me to the page I want. It takes me to a desktop from page and not my mobile form page of my registration form. Do I need to sent a call or something to take me or check for the profile of a phone form? I am using deeplink to take me to my mircoflow that will direct me to my form I need.