OpenFire + Converse.js Anonymous Login is false, Authentication Fails - openfire

I have installed OpenFire and Apache in windows, and created two users us1 & us2 in OpenFire. I have disabled Anonymous Login in OpenFire. Users able to login from Pidgin(XMAPP Client). Now Im trying to login from Converse.js, getting wired response in UI.
Here is Converse initialization
require(['converse'], function (converse) {
converse.initialize({
allow_otr: true,
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: 'http://localhost/httpbind/', // Please use this connection manager only for testing purposes
hide_muc_server: false,
i18n: locales['en'], // Refer to ./locale/locales.js to see which locales are supported
play_sounds: true,
prebind: false,
show_controlbox_by_default: true,
roster_groups: true
});
});
When I click login I see two requests going to server
<body rid='3144306786' xmlns='http://jabber.org/protocol/httpbind' to='us1' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
and Response is
<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" from="pgi-satishb" authid="655df560" sid="655df560" secure="true" requests="2" inactivity="30" polling="5" wait="60" hold="1" ack="3144306786" maxpause="300" ver="1.6"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features></body>
And Next request is
<body rid='3144306787' xmlns='http://jabber.org/protocol/httpbind' sid='655df560' type='terminate'/>
Response
<body xmlns="http://jabber.org/protocol/httpbind" type="terminate"></body>
Now I'm in dark, don't know what to do.

Nothing Helped so downloaded latest code from https://github.com/jcbrand/converse.js/archive/master.zip
which solved the problem

Related

cookie cannot be set due to user preference - withCredentials true, CORS set up

response cookie screenshot
response header
My site is able to save cookies if the frontend and backend are localhost:3000 talking to localhost:4000, but once I deploy them, it's no longer saving the cookies.
I am using Axios and Express to handle the http requests.
Frontend:
const axiosConfig = axios.create({
baseURL: process.env.REACT_APP_baseURL || "http://localhost:4000" ,
withCredentials: true
});
Backend cookie sending:
const token = jwt.sign(
{
user: existingUser._id,
sciper: input_sciper,
role: role
},
process.env.JWT_SECRET,
{ expiresIn: '1d' }
)
console.log("path /login correct")
res.cookie("token", token, {
httpOnly: true,
secure: true,
sameSite: "None"
}).send()
Express setup:
app.use(cors({
origin: [
"http://192.168.43.169:3000",
"http://localhost:3000",
"https://epfl-course-rank.herokuapp.com",
"https://www.coursefinder.ch"
],
credentials: true,
}));
The screenshot says that the cookie is sent, as it's in the response header, but not set by chrome (nor any other browser). If I hover over the yellow "!" button, it says "the set cookie is blocked because user preferences."
So if I change my cookie preferences to allow all cookies, my site works -- it still doesn't save cookie into Applications but at least it logs in and sends with requests.
I know there are lots of questions asked on CORS/Cookie setting already, but I am still lost after reading through dozens of them.
I set the credentials, the requests are sent with credentials as well.
It's also really bizarre that when I set my chrome setting to "allow all cookies", then my site works. Does this mean that chrome considers my cookie as third party instead of first-party?
Any help /explanations would be greatly appreciated.

Test automation of authorization prompt - chrome

I am trying to automate a simple login within this alert prompt authorization using cypress and javascript
I came across different solutions but I cant find the proper one.
What I actually do is I visit website with :
cy.visit('https://xxx/',{failOnStatusCode: false}) // Internal website with the fafailOnStatusCode: false
If I do not use failOnStatusCode: false I cant get to the prompt and I get an cypress message about using failOnStatusCode: false
But I am stuck after this step and neither cy.visit('https://username:password#xxx/',{failOnStatusCode: false})
is not working ...
Thanks for any comments and help. This is my first thread here :)
prompt
it('login prompt xxx', function () {
cy.setCookie("name", "value");
cy.visit("yourUrl.com", {
headers: {
authorization: 'Basic token'
},
failOnStatusCode: false
})
Test automated in cypress.
Open up the developer tools in chrome to find out these 2 things.
1.You have to know your cookie name and value from console. https://docs.cypress.io/api/commands/setcookie.html
2.Also you have to know your authorization which can be found in console.
https://docs.cypress.io/api/commands/visit.html

Parse-server: Reset Password

I am trying to implement my own local parse-server with my application. Everything is working fine except for reseting password for users.
I receive the following error
(node:8729) UnhandledPromiseRejectionWarning: Unhandledpromiserejection
(rejection id: 2): Error: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title><h1>Not Found</h1><p>The requested URL was not found on
the server.</p>
<p>If you entered the URL manually please check your spelling and try again.</p>
Do you have the email adapter configured in index.js? As per documentation,
Email verification and password reset
Verifying user email addresses and enabling password reset via email requires an email adapter. As part of the parse-server package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
var server = ParseServer({
...otherOptions,
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Parse App',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
},
...otherOptions
});

Basic authentication with Selenium in Internet Explorer 11

I read Basic authentication with Selenium in Internet Explorer 10
And I change my register key and when I use the user and pass in the url I don't see the basic authentication popup, but actually the page is not load. I see blank page!
I see my url in the IE but nothing happened - I see white page.
Must I change somethin in IE too?
It is not possible without some workarounds.
I also needed the same feature and previous SO answer confirms, that is it either impossible or possible with high probability of failure.
One thing I learned about Protrator is not to try to make too complicated stuff with it, or I'll have a bad time.
As for the feature- I ended up making Protractor to initiate Node.js task, which use request to make the authentication and provide back the data.
Taken straight from request module:
request.get('http://some.server.com/').auth('username', 'password', false);
// or
request.get('http://some.server.com/', {
'auth': {
'user': 'username',
'pass': 'password',
'sendImmediately': false
}
});
// or
request.get('http://some.server.com/').auth(null, null, true, 'bearerToken');
// or
request.get('http://some.server.com/', {
'auth': {
'bearer': 'bearerToken'
}
});

How to send post webrequest from javascript used in html loaded a in webview - titanium mobile?

I need to send post web request from titanium mobile webview.
Created a webview and included the below html code (Upload.html)
<html>
<head>
<script>
function loadXMLDoc()
{
//alert('asdfsf');
var xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST","https://www.mydomain.com",true);
xmlhttp.send('encrypted image string');
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
alert('xmlhttp'+xmlhttp.responseText);
  }
}
}
</script>
</head>
<body onload="loadXMLDoc()">
<h1>Sample</h1>
</body></html>
and used in webview as follows:
var webview = Ti.UI.createWebView({
url : 'Upload.html',
height : 100,
width : 100,
top : 0,
left : 0
});
On creating the webview console shows
2013-02-07 17:36:20.906 WebviewSample[6575:1f43f] [WARN] Unable to securely connect to api.appcelerator.net with the latest TLS. Trying again with TLS1.0. It is highly suggested that the server be updated to the latest TLS support.
[ERROR] Analytics error sending request: A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)
Although the console error may seem to be related to your webview I think it's not.
I think you have analytics enabled for your application and for some reason the SSL session is being rejected (time not correctly configured, etc.).
Disable analytics in your tiapp.xml and this error should not appear again, or try to figure out what is making the SSL connection to be rejected.
Second thought: If you're trying to post to an https domain and you're already having issues with your time config. it probably won't post anything through the webview because the SSL connection is also being rejected for the same reason as the analytics connection.