I am designing a j2me mobile application. In the design of the user I need to design the login page, register page and after finishing the login page i need to show the available records to the authorized user. can we use two or more MIDlets for this type of application.
You just need to use single MIDLET. Withing single midlet you can have mulitple classes with (lwuit/lcdui forms) say one form for Login and other for SignUP.
Simply use once class which extends Midlet.
Related
Our scenario is the following:
We have an SPA that we package and send to multiple customers.
The customers hosts the SPA on an arbitrary domain like www.unknown.com/spa/anything-goes, or www.also-unknown.com/spa/really-anything-goes, etc.
The customer also opens the SPA in a popup window and injects a service to communicate back and fourth from the popup (the SPA) and the main window.
The SPA uses our own API service, lets call it www.backend.com, as a backend.
The SPA also uses the service that is injected into the popup window by the opener (the customer website), meaning the main popup (where the SPA is loaded) window can't directly redirect to a common login page, because that will interrupt the connection to the injected service, and we can't modify the customer code to make it more robust).
We want to let the user of the SPA authenticate against our backend (www.backend.com) using SSO (their Microsoft credentials)
For any given (fixed) domain, we can make this work by approving the exact domain as an allowed Redirect URI in AzureAd, and just using the MSAL in the SPA.
But how would you go about using SSO when you don't know ahead of time which Redirect URIs to add in AzureAd?
We can't re-direct the SPA to a common login page (cleared in AzureAd), because that would break the connection to the injected service.
The msal-browser library has an option to use a popup window instead of a redirect directly in the SPA window, but this option also needs a pre-approved Redirect URI.
I'm thinking we may need to implement custom logic to let our SPA open a popup window that navigates to a page we can pre-approve as a Redirect URI, that itself has the MSAL library and does the SSO login and communicates the result back to our SPA. But before I attempt a custom solution like that, I wonder if maybe I'm missing something.
Is there a more standard, less "hacky", solution that I have missed?
We would appreciate any input, thanks!
We eventually went with the solution I hinted at in the question:
Publish a simple page including the MSAL library on a "central" location that we can pre-approve in AzureAD. Let's call that the Central SSO-page (CSSO).
Let each SPA, running on what ever domain they want, open a popup with the CSSO. This runs the MSAL and completes the login.
CSSO has logic that, on login-completion, communicates back to the SPA, using window.postMessage("Some message", "https://somerandomdomain.com")
The SPA sets up a listener window.addEventListener("message", handleMessage(){..logic here}).
The drawbacks are, as far as I can tell, mostly that you need to make sure you are posting the message so that only the correct window can receive it.
Another drawback is that popups are often blocked, but in our case that is unlikely since our SPAs are running from domains where the main way of loading our SPAs is through a popup, so for the user to even see our SPA, popups must already be allowed. Still, some fallback logic is needed to open the popup manually with a click (which seems to circumvent the default block of popups).
I have a route with a component that displays some form data. When I hit the submit button, I'll navigate to a different route that contains a receipt. If the user hits the back button, I want to remember what was entered in the form. How can I achieve this when using react-router-dom?
What you need is some type of data/state management for your react application.
Mobx is a good example for this. Search up how mobx works and how you can use this together with react.
With Mobx, you can store the user's form inputs in some type of class that you can decorate with mobx (for example DataStore class), which you can then read on your other page when you navigate there with router.
I started build a mobile application with ionic 3 framework and I want to manage 2 different type of user profile (trainer and simple_user). I want to understand how to do that after login success, I thought that add an attributes on the user table (isTrainer) and write some logic to know which user will be checked.
My api is written with nodeJS and client side will be with Ionic 3.
this is a photo that represent a class diagram. I want to understand the mechanism of management of user profiles in terms of user type.
During register use a field to check whether user is trainer or simple user. During login success return whether the user is trainer or simple user and direct to respective pages accordingly.
using php if that matters.
If you create a website that has users and groups. Where do you put this in the web application? Do you just put a function at the top of every page (pseudo):
if someone is in a group then they can see this page
or
if someone is in this group they can see this button
That sure seems wrong. I wouldn't want to edit the web app code just to change who can see what group-wise. I'm not sure what I should do or how to implement something like this.
Thanks.
In MySQL, I always create these 4 tables: users, user_groups, permissions and user_groups_permissions which are linked using Foreign Keys.
So, user A can be in a user group B, which this user group permissions are in user_groups_permissions.
Now, I just do a INNER JOIN on this 4 tables (or better, three: users, user_groups_permissions and permissions), the results are permissions that user have. all we need is selecting permissions.key by INNER JOIN.
Now, before processing request, I need to check that Client::has_permissin('send_post') returns true or not. And better, also on top of each user-group-related function.
Note: Client is a class that loads all user permissions just one time, before processing request, and then uses that permissions for whole request-life-time, without needing to access to database several times in that request. Use static methods and $permissions property for this class so you never need to send it's object over your applications classes/methods/functions :)
You can have a utility function which takes user id and group code and return true or false.
You can use that utility function as pseudo at the top of each page and the same function also be used to hide or show sections in your page.
If your web application is in MVC, embed user authorization logic in your controller.
I have just started using GWT for web interface for our application.
My app has three different views for three different types of users. Each user has different type of interface (i.e. different navigation different menus etc).
There is one login page which will be index page of the application. The user shall enter the credentials and will be redirected to his/her section.
My problem is that how I can transform this scenario in GWT context. Weather I shall have four modules (i.e. one for login and other three for three type of users); weather there will be one module and I just have to change/load panels according to the user view type.
How shall I integrate these modules into one app? Weather I have to use JSP's to integrate these modules? Or these modules can be integrated by GWT to make a complete app.
Kindly help me in this regard.
Cheers
Raza
You could opt for having one module and via code splitting load the specific interface for the user.
Depending on your login procedure there a different ways to load the specific user interface. If the login is done in GWT code, so the login page is part of the application, then for example if the user logs in via a RPC call upon successful login a value is returned that indicates which user interface to start. Or if the login is done prior to loading the gwt page, for example if you use the standard webserver authentication, than the index page returned, which contains the gwt app, upon successfull login can already contain a variable generated in html which is than used to guide which user interface is loaded. These are just very generic ideas, but I hope you get the idea.
Regarding several modules. If you have 3 different modules, your build time also becomes 3 times as long, because GWT needs to generate 3 different applications.