07-08-2023 05:14 AM
Hello community,
I am designing a login page for an application using G web development and I am using websocket to communicate with the server. My question is that I have no idea about the secure design of the login page, that is, what should be done after designing and receiving the username and password from the user and sending it to the server and after getting the result about the login permission? How do I use standard access management methods? How can I find out if the user is logged in and manage access to different parts of the software? How can I work with cookies?
how can I use Microsoft identity platform?
Please take me some basic information
Thanks.
07-08-2023 01:21 PM
Anything that runs via programming in G Web and therefore runs in the client browser is not secure. The only thing that could be seen as secure about it is if the user doesn't know how to use a browser's developer tools and inspect / manipulate the page. G Web runs a bit more obfuscated than most websites but it doesn't count as "secure" for anything that would be public facing. If you need any kind of traceability and actual security that is always accomplished via a backend server and not in G Web itself. If you're building a site for a single company's internal use and you just need to provide specific experiences to specific people and crafty people isn't a concern then you can get away with some basic state management in the G Web app.
If you need more security, a typical approach is to have the server provide some kind of token (session, API, etc depending on the server auth mechanisms) that any further requests to the server could include the token and the server would validate that the token is still valid. In short, most of the things you're asking about all happen server side and not in G Web itself.
G Web doesn't provide access to cookies. You would need to do some JSLI wrappers to call javascript code that can work with local storage / cookies. Alternatively, if you're doing GET and POST requests to your server, the server could handle the cookies on server side that a browser would automatically include in any further requests to the same server and that's typically how things like user sessions are managed.
Outside of using the authentication mechanisms built into NI Web Server that limit access to G Web Apps up front, if you don't already have experience with building/using authentication for websites then this will be an arduous path to tread. G Web is designed to build relatively simple data display and control applets and venturing beyond that is going to be a bunch of manual effort.
07-08-2023 11:44 PM
07-09-2023 06:33 PM - edited 07-09-2023 07:03 PM
Outside of using the authentication mechanisms built into NI Web Server that limit access to G Web Apps up front
I think they (G web developers) should consider implementing access management tools.
Just to emphasize in-case it is useful for the application, G Web Development software does include a path for providing access management for Web Applications. If you leverage the services included with G Web you can achieve those kind of workflows out of the box and alternatively you can pick and choose the pieces of G Web that are useful but then may have to build out more of those workflows yourself.
The out-of-the-box / expected workflow of G Web Development Software looks like the following:
This affords you some flexibility:
How access control works in these workflows:
How to integrate with Windows login on the NI Web Server:
If that kind of workflow sounds useful for your application or you want a more complete overview of the different ways you can use G Web to make a Web Application I'd recommend going through the How to Build a Web UI for Your LabVIEW-Based Test System presentation and try experimenting with the demos.