Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Can't we perform login using C# code instead of $app.login?

Hi, all.

I know that $app.login can be used to perform login via JavaScript.
But now I would like to create a new .aspx login page (without COT framework) and call the C# Login function "public static object Login(string username, string password, bool createPersistentCookie)". Once user credential is true, it will manually update the localStorage.identities and redirect to COT page.
Is there any URL web service to call?

Regards
Justin
1 person has
this question
+1
Reply
  • 2
    [Solved]

    For those who want to write a new Login page (outside of COT framework but within the project)

    Send a post request to <domain url>/_invoke/Login
    with the body of 
    {
     "username":"user",
     "password":"user123%",
     "createPersistentCookie":true
    }
    If username & password is valid, you will get the result of
    {
        "d": {
            "name": "user",
            "email": "user@test.com",
            "access_token": "...",
            "refresh_token": "...",
            "picture": "",
            "claims": {}
        }
    }
    else you will get
    {
        "d": false
    }
    Now, update items 'identities' & 'avatars' from localStorage with the return result via JavaScript.
    Then redirect to page with COT framework, it will show that user has been logged in.

    Regards
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • can some one help me to call the apis in blazor app

    as a consultant
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated