NetTalk Central

Recent Posts

Pages: [1] 2 3 ... 10
1
Web Server - Ask For Help / Re: Pass a Session Variable as a parameter?
« Last post by JohanR on Today at 08:20:43 AM »

Hi Jane

Thanks , I do pass p_web into other functions and have that working when it's functions that work with p_web and session variables,
but in this case it's a function that only receives a stringtheory object and then populates the data.

It's unaware of which specific session variable to load or unaware that it's a NTWS

I have it working with a temp stringtheory object, was just looking at it and thinking there was a way to reference the session variable as a stringtheory obect and then pass that in.


thanks

Johan




2
Web Server - Ask For Help / Re: Pass a Session Variable as a parameter?
« Last post by Jane on Today at 08:02:24 AM »
Pass the p_web object as one of your parameters.

Here's a prototype example from one of my procedures where p_web is the first of two parameters I'm passing.

Code: [Select]
(NetWebServerWorker p_web,LDAPParametersGroupType pParms)
3
Web Server - Ask For Help / Re: Pass a Session Variable as a parameter?
« Last post by JohanR on Today at 04:47:44 AM »
Hi,

Sorry had to add, this is how I am doing currently.

my_tmp_st  stringtheory

     MyFunction(my_tmp_st)
     p_web.SSV('session_var',my_tmp_st.GetValue())


Johan



4
Web Server - Ask For Help / Pass a Session Variable as a parameter?
« Last post by JohanR on Today at 04:33:26 AM »
Hi,

Sure I know this but it's buried in the year end brain fog of too much screen time and not enough down time....
Think I might even have asked this somewhere, sometime, but cannot find the answer. :)


How to pass a session variable to a function.

As I understand session variables are stringtheory objects, so if I have a function like
MyFunction(stringtheory tmpstr)

How do I pass a session variable into that function without using intermediary strings



thanks


Johan







5
Web Server - Ask For Help / Re: Webserver and secwin 7 Logout with default deny
« Last post by seanh on November 23, 2025, 05:14:43 PM »
I've managed to solve this with a bit of a hack.
I've added the following code to p_web.RestrickOK  in the webhandler

        if pProcedure = 'SecwinLogoutWeb'   !smh Hack to get logout ok
            ReturnValue = sw:CanAccess
        END

It doesn't really feel like the right/best way do do it.  But it does work.
6
Web Server - Ask For Help / Re: Anyone have passkeys implemented
« Last post by Jane on November 19, 2025, 02:29:15 PM »
Thanks, Sean.

I had rolled my own AD groups permissions for web apps before SecWin 7 was released and it works OK.  I just took a quick look at SecWin 7's groups when it was released and couldn't see an easy way to make it work seamlessly for what I needed so stuck with what I already had.

Hope you're doing well.

Jane
7
Web Server - Ask For Help / Re: Anyone have passkeys implemented
« Last post by seanh on November 19, 2025, 02:22:23 PM »
Jane, 
I don't use secwin in the app I have that uses AD so I've never looked.   
8
Web Server - Ask For Help / Re: Anyone have passkeys implemented
« Last post by Jane on November 19, 2025, 10:07:50 AM »
Quote
Secwin 7 has something akin to this

Good to know, Sean.

Off topic from the passkey question...

I played a very little bit with Secwin 7 when it first came out.
I couldn't find a way to assign permissions within an app to nested Active Directory groups, rather than to Secwin's own groups.

So to avoid more instruction for our IT people, I coded my own thing querying AD to get group membership for the person logging on and then assigning permissions in code.  That way, when staff changes the IT people can just assign people to relevant AD groups and don't need to be familiar with my apps.
Not as flexible as far as changing what a particular group can do, but those group roles are rarely changed once an internal app is put into service.

Are you able to use AD groups (including nested groups) directly now in NetTalk with Secwin?

Jane
9
Web Server - Ask For Help / Re: Anyone have passkeys implemented
« Last post by seanh on November 18, 2025, 10:20:46 PM »
Secwin 7 has something akin to this.   It allows you to logon once and get a token so you don't need to login again for n days.
It also has a number of other authentication methods I haven't tried.
10
Web Server - Ask For Help / Re: Anyone have passkeys implemented
« Last post by Jane on November 18, 2025, 06:11:25 PM »
Not real passkeys.

What I have implemented on a few internal apps is use of a one-time token.
Somebody is logged into a SQL report server and part of running certain reports generates a GUID token in a SQL database.  The table has an expiration date/time.

They can then link from the report server to one of my internal web apps with a URL that passes that token and specifies an internal "Connect" netWebPage.

The webHandler has an overload of p_web.Authenticate that just has a single parameter for pBearerToken.
That version of the method validates the token against the list in SQL.  If valid, then it falls into my code for setting permissions and stuff just like a regular name/password login.

I'm sure there are more elegant options for passing the token.
What I did is

1. Create a NetWebPage which I call Connect
2. In the Connect page, there's a local variable
            _token  STRING(40)
3. In the Connect page, shortly after the CODE statement, I have the following code:
Code: [Select]
    _token = p_web.GetValue('c')
    IF p_web.Authenticate(_token)   
      p_web.Script('window.location.replace("/IndexPage");')
    ELSE
      p_web.Script('window.location.replace("/LoginForm");')
    END ! if   
4. My SQL report has a link to pass the token to the web app   
           theWebAppURL/Connect?c=[THE TOKEN VALUE]

This was quicker to throw together for an internal app, rather than trying to come up with a correct implementation of basic authentication.  But regardless of how you snag the token that's passed to you, you can use the pBearerToken version of p_web.Authenticate.



Pages: [1] 2 3 ... 10