Jump to content
Sign in to follow this  
mazluta

How do i control the Login Form shape of Datasnap Rest Service

Recommended Posts

i just create rest service with authoticate entry. the default login form look like this :

 

image.png.ea3f075ccf22ae9f18c79a7dd0f85814.png

 

how can i change the login form as i want and control the form shape? lables, headers, positions

 

Share this post


Link to post

Datasnap is intended for serving applications with data, not for being a custom Web UI.

Not sure if you can customize any html part of it?

Share this post


Link to post

first, thanks.

 

I use my rest to get a PDF file as base64, a digital sign with some digital certificate.

based on the user's table I want to popup him with the login form.

 

but I don't want him to see the "Server Function.." label.

 

Share this post


Link to post

you can hide any function for users not-admin using "attributes"  

https://docwiki.embarcadero.com/Libraries/Sydney/en/API:Datasnap.DSAuth.TRoleAuth

 

https://stackoverflow.com/questions/5354812/delphi-datasnap-authorization-not-repecting-troleauth-attribute

 

customization can be done on events before send to client, or using a frameworks (3rd) like done by Intraweb, UniGui, etc... 

Edited by programmerdelphi2k

Share this post


Link to post

".....customization can be done on events before send to client, or using a frameworks (3rd) like done by Intraweb, UniGui, etc...  ....."

 

can i write Web Service with UNIGUI ?

Share this post


Link to post

you can try "just comment this line on source"

procedure TWebModule1.ServerFunctionInvokerHTMLTag(Sender: TObject; Tag: TTag; const TagString: string; TagParams: TStrings; var ReplaceText: string);
begin
...
  else { if SameText(TagString, 'serverfunctioninvoker') then
         if AllowServerFunctionInvoker then
            ReplaceText := '<div><a href="' + string(Request.InternalScriptName) + '/ServerFunctionInvoker" target="_blank">Server Functions</a></div>'
         else }
    ReplaceText := '';
end;

image.thumb.png.77ae3438ee0e8420cc0070d75ce4fabb.png     here the page is called if link is alive image.thumb.png.9cabae0a849910ae289c8956493e7abb.png

Edited by programmerdelphi2k

Share this post


Link to post

all response is done by html, then, you can create yourself "page html" and use it as your Login page!!!

see the "...\Project1\templates, ..Project1\css, ...Project\images" folders   ... see the templates default: reversestring.html, serverfunctioninvoker.html

 

or you can use the a "TPageProducer" component and link to "PageXXXX.html" or just type your "hmtl code"  in HTMLDoc property!!!

you can use any HTML tags, include CSS for create your layout with all valid tags! no needs 3rd at all

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×