RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.36k stars 10.48k forks source link

IFrame Authentication not working #10849

Closed jpotts-IIL closed 1 year ago

jpotts-IIL commented 6 years ago

Description:

As far as I can tell I have set up IFrame authentication as described in the docs. However, I have been unable to login with the API URL.

It has been implemented in Django and my API URL points to:

@csrf_exempt `def apiurl(request):

get loginToken

r = requests.post("http://li353-116.members.linode.com:3000/api/v1/login", data={'username': 'user', 'password': 'pass'})`

if r.status_code == 200:
    j = json.loads(r.content)
    resp = {}
    resp['loginToken'] = j['data']['authToken']
    print json.dumps(resp)
    return HttpResponse(json.dumps(resp), status=r.status_code)
else:
    return HttpResponse('', status=401)`

(Sorry cant seem to get the formatting of the code correct)

From what I can tell, I am responding with a valid loginToken. However rather than logging in as expected, it redirects to the IFrame URL.

Am I missing something in the response?

mr-asher commented 6 years ago

Are you still having issues with this? I've just hooked up Rocket Chat to a django installation successfully through an iframe.

tylerkahn commented 4 years ago

For posterity's sake, this is most likely due to a CORS issue. You need to enable CORS access on your SSO server for your RocketChat endpoint. Open up the dev console and and the browser will tell you why it's failing.

gabriellsh commented 1 year ago

Thanks @tylerkahn.

I'll be closing this since it's very stale. Please open a new report if you have issues.