OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.26k stars 2.35k forks source link

Liquid: Get user ProviderKey by LoginProvider #7940

Open chinasqzl opened 3 years ago

chinasqzl commented 3 years ago

{% assign providerKey = User | provider_key : 'WechatWork' %}

image

Push messages through the service provider to get Key。

通过服务商向用户推送消息一类的业务。

Piedone commented 2 months ago

What's the use case for this?

chinasqzl commented 2 months ago

To call the API of a service provider, you need to pass the UserId of the provider.

image

hishamco commented 2 months ago

I'm not sure what are you trying to do, perhaps UserByLoginInfoIndex might help

Piedone commented 2 months ago

Why do you need to do this from Liquid? Because yes, otherwise the value is available.

chinasqzl commented 2 months ago

workflow, using HttpRequestTask

image

Piedone commented 2 months ago

I see. Would JavaScript work for you as an alternative, with the Script Task? I don't know if that has this value accessible (it has some auth-related), but it would be more fitting to add there instead of Liquid. Then you can supply the inputs of the Http Request Task from that Script Task.

chinasqzl commented 2 months ago

ok