1

Login to https://hosting.wialon.us/ using Form Post Event

(18/03/2019 21:10:26 отредактировано satyam87)

Тема: Login to https://hosting.wialon.us/ using Form Post Event

Hi,
I had problem with getToken which i have overcome.
I try this approach but its not working.

We want to directly login to the wailon project by-passing login.
Can you help me with proper steps to overcome the issue. I tried many steps but all were unsuccessful.

<form method="POST" action="https://hosting.wialon.com/oauth.html?success_uri=https://hosting.wialon.com/post_token.html" id="auth-form" onsubmit="checkLogin(event)">
        <input type="hidden" name="response_type" value="">
        <input type="hidden" name="client_id" value="App">
        <input type="hidden" name="redirect_uri" value="https://hosting.wialon.com/login.html">
        <input type="hidden" name="access_type" value="256">

        <input type="hidden" name="activation_time" value="0">
        <input type="hidden" name="duration" value="604800">
        <input type="hidden" name="flags" value="7">
        <input type="hidden" name="sign" value="D5HVFFw9LaPn7odCubedZk6iANhjW5OVZGtH5hOjTCg=">

        <input type="text" class="" name="login" id="login" placeholder="User" value="bizringer" autocapitalize="off" autocorrect="off" dir="auto">
        <input type="password" class="" name="passw" value="CDKHoekFCH" placeholder="Password" autocapitalize="off" autocorrect="off" dir="auto">
        <input type="submit" value="Authorize"><div id="error_div" class="err" style="display: none;">Invalid user name or password</div>
    </form>

I am getting this error:
Your IP has changed or session has expired. Try again please.

My Goal is to..automatically login to wailon web portal from our website.

Thank You....

2

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

Hello!

you need to implement authorization form at your website, for example like iframe
Please find example in this documentation

Diana Cheley
Wialon Hosting Expert
Gurtam
3

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

but this way we cannot directly login to the web portal, I want to by pass the Login page.
is there some way or api etc

4

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

Authorization allowed only via login.html form.

We are generating those temporal sign values to prevent authorization by user/password directly to not encourage their storage/transfer in potentially insecure environments.

To implement your usecase you need:

1. Obtain tokens of every user you need to login (by using login.html form)

2. When user want to login to Wialon from your website, execute token/login with that token from your webserver, then redirect user to:

https://hosting.wialon.us/?sid=<eid>

If you have many users to which you need to login, you can create token only for top-user and then create tokens for child-users automatically. Sadly, core/create_auth_hash doesn't have optional "user" parameter to not create intermediate tokens for child-users, tell us, if you need it.

5

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

sorry, i am not able to by pass login.html and go directly inside the web portal.
I tried several steps like form post, filling up login html page with default data and execute button click event, but none of them worked.
I also got a cross origin error.

CAn you give me a sample where i internally fill up necessary information like username and password and go inside the portal.

6

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

Hello!

Please look here example how authorization form can be embedded to site

Diana Cheley
Wialon Hosting Expert
Gurtam
7

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

Hi,
passing token in  https://hosting.wialon.com?token=..   worked.
Now, I am searching for Login method where i can pass username & password and get token address.
I saw few exmples like  https://sdk.wialon.com/playground/demo/ … imple_form

But i dont want it this way, I want to call the api internally and get the token for the user.

Can you help me with that, mean while i am also looking for it.
Please suggest..
Thank you

8

Login to https://hosting.wialon.us/ using Form Post Event

Re: Login to https://hosting.wialon.us/ using Form Post Event

satyam87 пишет:

Hi,
passing token in  https://hosting.wialon.com?token=..   worked.
Now, I am searching for Login method where i can pass username & password and get token address.

the following link https://hosting.wialon.com?token=..   is login request.
There is not login request with username/password, only via token. You pass username/password only on authorization form from which you get token to login.

But i dont want it this way, I want to call the api internally and get the token for the user.

You cannot call any api request to login or get token without going through authorization form.
It's secure way of authorization. When you go = pass username/password through authorization form you will get token to login and also there will be singed to secure data.
You can get unlimited token = pass parameter duration = 0, so it doesn't need to get token every time. User can login = pass username/password only once via authorization form. Then you can math user's token with user name at your database, and use direct link to login via token to corresponding username.

Diana Cheley
Wialon Hosting Expert
Gurtam