none
Implement OAuth when posting values from winforms to website RRS feed

  • Question

  • I want to implement an OAuth types of authentication when posting values from winforms to a aspx website. I found something on Claims Principal using WIF. Wanted to know if this is the right approach in doing so.

    My website uses Forms Authentication so passing credentials (using HttpWebRequest) is not possible, as credentials passing only works in case of Windows or Network Authentication. But I can pass credentials as a Request Form values in aspx site and use that in with "SignInManager" class object and verify the user. Is this a recommended approach?.

    Also I want to capture Session variables as well which was set before calling a winform app from my website. Now while posting the values back to my website from winform, I want to access the earlier set Session variables in my website using the Claims Principal, can this be done?.

    Any helpful links or suggestions or ideas would be great.

    Thanks In Advance!!!..

    Monday, July 15, 2019 8:12 AM

All replies

  • Hi Siddy Boy,

    >> My website uses Forms Authentication so passing credentials (using HttpWebRequest) is not possible, as credentials passing only works in case of Windows or Network Authentication.

    As far as I know, we could should use http to access asp.net website that means we should generate the http request in your winform and send the request to asp.net website to login the user.

    Normally, asp.net web site will generate the token after login in. So I suggest you could send the request to asp.net web site to login in, then it will return the response to the win form. Then you could get the token from the response and use that token access the asp.net website.

    >> Also I want to capture Session variables as well which was set before calling a winform app from my website

    As far as I know, there is no concept of session variables in Windows Forms.

    If you want to use session in winform, I suggest you could consider using sql server as the session state sever and use session id to search the sql server session table to get the session value.

    For details, you could refer to below article:

    https://support.microsoft.com/en-sg/help/317604/how-to-configure-sql-server-to-store-asp-net-session-state.

    Because this issue is more relevant to ASP.NET, it will be more appropriate to ask your question at ASP.NET Forums.

    Thank you for your understanding.

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 16, 2019 5:41 AM
    Moderator