Похожие чаты

Hi I want some suggestion. Currently I've made a realtime

db service and it's server is in java, I'm using tomcat to display whole DB on a webpage, now I want to protect that webpage(offline i.e. client don't req internet connection to login), what should I use to achieve the same?

should I simply store username n pw in the server and make it read only?

and should I make a login page and make a common json file that sets something like {"auth": "true"} on loginSuccess and redirect it to the db page; and when that's loaded it set's auth to false.

Ik this is the worst auth I could provide but I don't need some fancy auth system, but pls tell me if there's some better way and that does not consume much time to make.

12 ответов

28 просмотров

It feels like you have not very clear understanding how server-client web applications work in general. I recommend you to first spend some time on this topic. Just explore how web apps usually work, how http is used there, etc. (I have no idea about that "offline part", I'm pretty sure you're not talking about PWAs, thus it's just doesn't make sense for web applications to "authenticate offline") After that search for "http basic auth", this is the easiest way. And the way of implementing it highly depends on the framework you're using, so google for "<your framework> http basic auth".

eh- Автор вопроса
Dmytro Buryak
It feels like you have not very clear understandin...

With offline auth I mean just like how you log into your computer. Basically the webpage is supposed to access only by 1 person and the server file would be destributed to a people as a whole and webpage is part of it so I don't want to use proper auth(like google auth) and make them use internet

Why you need "server in java" then? Can you explain what exactly your application is about? You're talking too abstract, and in general the design you came up with doesn't make much sense.

eh- Автор вопроса
Dmytro Buryak
Why you need "server in java" then? Can you explai...

As I said I've made a realtime database service, with server I mean the server which maintains the JSON and responds to the requests what clients make. With clients I mean the android/iOS/any other client which uses my dependency. GitHub.com/ssddcodes/ssddrtdb here's it explains how to use it (as a client)

eh- Автор вопроса
eh
As I said I've made a realtime database service, w...

And in the server I've used tomcat and to pretty print and edit the json.

eh
As I said I've made a realtime database service, w...

Perfect! So now let's say I deploy this service in Finland, so the data is stored on some disk that is physically in Finland. And people in Germany, Australia and India are connecting to it and doing crud operations with it. What do you mean by "offline, don't have internet connection"? Imagine that the data center in Finland is hit by snow storm and there's power outage there, it doesn't work. Data stored on that disk is physically unreachable. What do you expect people in Germany, Australia and India to see on their apps when they launch them? And what they are expected to authenticate against? (in other words, whom should they prove their identity, who should verify their passwords and logins?

eh- Автор вопроса
Dmytro Buryak
Perfect! So now let's say I deploy this service in...

For it's main functions like createing and updating fields they don't req auth that's a ws connection, for that auth is different, it's done by app's package id and certificate. But the person having access to the webpage have access to full database and can edit anything (which clients can not as owner can set permissions for the fields) I just want to protect that. The reason I want it offline is imagine there's a hotel using this on their local server so they don't have to connect to internet and pay for bandwidth whatsoever and if I add google login or something they need internet. Finally thx for the situation tho, currently they need physical access or need to see the content(however if the user have the port open for the database they can still access it remotely)

Ah, that explains it! I mistook "no internet" for "no network connection between web client and server". Google for "http basic auth", it's basically sending username and password with http request approach. Should do the trick for your case. For example redis auth is similarly simple and basic.

eh- Автор вопроса
Dmytro Buryak
Ah, that explains it! I mistook "no internet" for ...

Yes but where/how to store the auth credentials I want it to be offline too so need to store credentials in server itself, that's what my question is, how to save credentials so people can't access it easily

No, jar is readonly. Think of jar as ".exe" file in windows. Or like game data files in games. Data in that files is same for millions of installations. But personal configurations, or game saves files, they are individual and they are not part of distribution, they are created individually for each individual installation.

eh- Автор вопроса
Dmytro Buryak
No, jar is readonly. Think of jar as ".exe" file i...

🤔 earlier I kept and used a json file in the jar itself and I was able to edit and read it without any complications

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта