Ajax login and get data as json (OpenAM) -


I want to log in as a different user when I click on separate button through OpenMM and the results Show me voluntarily I try the OpenM Develop guide but I do not get any information.

3.3.1 Authentication & amp; Logout (This is called Weight Openem)

## The easiest username / password authentication gives a token that the cookie value for other tasks requiring application authentication Can present in In this case, use HTTP POST to prevent web containers from logging credentials. Pass the password into the user name in the x-openm-username header, and the x-openm-password header. $ <-> $ curl \ - support post \ - header "x-open-user name: demo" \ - header "x-openm-password: change" \ header "Content-Type: App / Jason" \ --Data "{}" \ https: //openam.example .com: 8443 / OpenM / JSN / Certified {"ToonId": "AQIC5w ... NTcy *", " This "zero page login" mechanism only works for name / password authentication if you include a posting body with the request: successUrl ": / openam / console"}

, Look as an example Or should have been an empty JSON string. Alternatively, you can leave the post exit empty. Otherwise, OpenMe describes the body as the continuation of an existing authentication effort, which uses a supported callback mechanism.

/ Authentication service on JSON / authentication supports callback mechanism, which allows authentication other than normal user name / password login.

The callbacks that have not been completed based on the client's content have returned requests to the JSN as a response to the request. Output is appropriate to show the end user in each callback, and input which the customer has to complete and send back to OpenMe. The default still has username / password authentication.


My code main.html

  $ ('# try'). Click (function () {var uid = "user"; var password = "password"; $ .ajax ({type: "POST", url: "https: //mytomcatlocalhost/itapp/app3/app3.jsp") Data type: "jsonp", "app / jason", success: function (jadata) {alerts ("h", "a", "x-openm-usernem": uid, "x-openm-password": password} );}} & Lt; button id = "try"> user1   

but I'm not really sure what callback does, and App3.jsp is such an application whether my direction is correct or not. Which allows only the user to successfully log in after opening it. But how do I login automatically?

I value the URL

 " https: //mytomcatlocalhost/itapp/app3/app3.jsp "  

Your The app is URL and OpenM is not a REST Youth ... Are you using OpenM Rest in Bean, your JSP?

If not, the code provided by you or Do not understand Tv.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -