Global identity from Identify not working

How exactly are you trying to use the identify step in your server action? Please share a screenshot of the steps.

It’s working for me now.

  1. I’ve set up the globalidentity in the Globals

  2. Set up the security provider a bit below

  3. Tested it in a query

I did install the app.zip that Patrick gave me in the other thread. So I can’t testify that it works without the app.zip

(I’m also on 3.5.7)

Is the user logged in when you are testing the identify step?

So delete this file and re-save your server action. This will add the latest version of the file in your project.

Done that, still available for me:

Btw @Teodor does that mean if I have installed small updates in the past given by Patrick, I should remove those files when Wappler updates? (I thought it would get overwritten)

Not sure what you mean by “still available”?

No you should not do this …

Sorry but i really can’t understand what issue are you having exactly.

@Teodor I think you’re confusing me with OP haha

@Emiel is having issues, but linked my post from 18 days ago Global identity from identify action step not working

So I just wanted to help out by letting you guys know that it has been fixed for me

Yes actually i confused you with him.

So the question to @Emiel is still:

Hi @Teodor,

I am using the security identify as a step before a database query, where I use it as a condition, like this:

Also tried removing the security identify step from this server action and setting it as a global and using that for the db query condition, but problem persists in that way too.

Identify doesn’t need to be added as a step in the server action. It should be defined under globals.
Are you sure the user is logged in when calling this server action?

I tried using it as a global in the first place, which didn’t work. That’s why I tried it as a step in one of the server actions I need it in.

I am very sure the user is logged in properly, because another action using the old setup with a security provider still works and gets all the logged in user’s data.

Another strange thing is that when I setup that properly working action again in a new action file or try to reset this action after changing it to it’s initial state after I modified it, it doesn’t work anymore. I tried several times and only discarding the changes for the server action file in the git manager fixes it.

So, in short:
A. The sec identify doesn’t work as a global in new action files.
B. The sec provider (old-fashioned way) doesn’t work either anymore when setup again exactly the same as currently well functioning server actions.

Is the security provider in globals properly defined? Open its settings and reapply them.
Also - enable the output for the global identify and check the server action response in the console. Also make sure the identify is pointing to the right security provider in the menu - as i see you have different identify steps - not sure why.

Tried all that already. Set it up again and checked all the settings once more and reapplied them.
This is the response in the console, should have sent that in the first place probably :see_no_evil:

{"status":"500","message":"Cannot read property 'toLowerCase' of undefined","stack":"TypeError: Cannot read property 'toLowerCase' of undefined\n at App.setAuthProvider (/opt/node_app/lib/core/app.js:123:64)\n at App.provider (/opt/node_app/lib/modules/auth.js:5:31)\n at App._exec (/opt/node_app/lib/core/app.js:255:57)\n at App._exec (/opt/node_app/lib/core/app.js:234:28)\n at App.exec (/opt/node_app/lib/core/app.js:205:20)\n at App.define (/opt/node_app/lib/core/app.js:188:20)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)"}

Any news on this?

I setup and saved all the Identify globals.

Also created new server action file with 3 steps:

  1. Security_provider
  2. Database query with identity from security provider as condition filter => Returns data correctly.
  3. Duplicate of 2. with global Security Identify as condition filter => Doesn’t return data.

Thanks for any help in advance.

Please check the json files located in app/modules/SecurityProviders. That’s where the configuration of your security providers is stored. Check the json files if they all contain the provider option, it should be set to Single, Static or Database. The error you are getting is when that option is missing in the options.

Hi Patrick, checked the json files right away and they all do have values set for the provider option.

Please unzip following file in lib/core.

app.zip (3.8 KB)

In the console you should see some extra logging about which security provider it is trying to get/set and what its options are.

Sorry, it breaks the app, doesn’t load anymore at all. When the original app.js is restored, it does load again.

Did you get an error in the console?

No nothing, the app just doesn’t respond at all so the page (or any other) is not loaded when the app.js file is replaced with the one you sent.