Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help debugging: SLO SAMLresponse TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object. #33

Open
tuxcrafter opened this issue Mar 20, 2019 · 14 comments

Comments

@tuxcrafter
Copy link

Thank you in advance for any help.

I am trying to debug code in steffo_meteor-accounts-saml.js in rocketchat to see where my saml intergration with ipsilon goes bad.

This is the error I am receiving:

Sorry, an annoying error occured
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
Close Window

I have more details here, but the error is thrown from saml.js and not ipsilon.
https://pagure.io/ipsilon/issue/316

Thank you!

@steffow
Copy link
Owner

steffow commented Mar 21, 2019 via email

@tuxcrafter
Copy link
Author

Thank you for replying! This is an IdP initiated SLO that seems to go bad. I am using ipsilon-2.1.0-3.fc28 connected to freeipa. If you can help me debug and solve this I can donate to your cause. I can provide you with access to the server and an test account, just sent me a message.

@steffow
Copy link
Owner

steffow commented Mar 25, 2019 via email

@tuxcrafter
Copy link
Author

The logs including with debug on are in the URL: https://pagure.io/ipsilon/issue/316 in posted in the OP. I can provide access to the machines as well,

@steffow
Copy link
Owner

steffow commented Mar 25, 2019 via email

@tuxcrafter
Copy link
Author

I don't think I know where the settings.js is located in Rocket.Chat.

[root@rocketchat01 Rocket.Chat]# find /etc/ -iname settings.js
[root@rocketchat01 Rocket.Chat]# find -iname settings.js
./programs/server/npm/node_modules/meteor/rocketchat_katex/node_modules/katex/src/Settings.js
./programs/server/npm/node_modules/twit/lib/settings.js

[root@rocketchat01 Rocket.Chat]# cat ./programs/server/npm/node_modules/meteor/rocketchat_katex/node_modules/katex/src/Settings.js
// @flow
/**

  • This is a module for storing settings passed into KaTeX. It correctly handles
  • default settings.
    */

import utils from "./utils";

import type { MacroMap } from "./macros";

export type SettingsOptions = {
displayMode?: boolean;
throwOnError?: boolean;
errorColor?: string;
macros?: MacroMap;
colorIsTextColor?: boolean;
maxSize?: number;
};

/**

  • The main Settings object
  • The current options stored are:
    • displayMode: Whether the expression should be typeset as inline math
  •             (false, the default), meaning that the math starts in
    
  •             \textstyle and is placed in an inline-block); or as display
    
  •             math (true), meaning that the math starts in \displaystyle
    
  •             and is placed in a block with vertical margin.
    

*/
class Settings {
displayMode: boolean;
throwOnError: boolean;
errorColor: string;
macros: MacroMap;
colorIsTextColor: boolean;
maxSize: number;

constructor(options: SettingsOptions) {
    // allow null options
    options = options || {};
    this.displayMode = utils.deflt(options.displayMode, false);
    this.throwOnError = utils.deflt(options.throwOnError, true);
    this.errorColor = utils.deflt(options.errorColor, "#cc0000");
    this.macros = options.macros || {};
    this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false);
    this.maxSize = Math.max(0, utils.deflt(options.maxSize, Infinity));
}

}

export default Settings;
[root@rocketchat01 Rocket.Chat]# cat ./programs/server/npm/node_modules/twit/lib/settings.js
// set of status codes where we don't attempt reconnecting to Twitter
exports.STATUS_CODES_TO_ABORT_ON = [ 400, 401, 403, 404, 406, 410, 413, 422 ];

@steffow
Copy link
Owner

steffow commented Mar 25, 2019 via email

@tuxcrafter
Copy link
Author

tuxcrafter commented Mar 25, 2019

chat mctest nl_-_2019-03-25_17 07 56

Please sent me an email, its in my gitub profile and I will provide access to the server and a test account. SSO is working fine.

@tuxcrafter
Copy link
Author

@steffow can you guide me in debugging the error or willing to log into the server. It seems to be server side javascript that is generating the error and I have a hard time debugging the code flow.

@steffow
Copy link
Owner

steffow commented Mar 30, 2019 via email

@tuxcrafter
Copy link
Author

@steffow I reached out on RocketChat: RocketChat/Rocket.Chat#13831 and
RocketChat/Rocket.Chat#9545 but no reply in the last two weeks yet.

What is the NameIDFormat steffo_meteor-accounts-saml.js works with?

The metadata indicates:
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress

But the @ may cause issues in the code?

@tuxcrafter
Copy link
Author

tuxcrafter commented Apr 2, 2019

@steffow I have a javascript developer debugging the code and it seems to be an bug in:

const compressedSAMLResponse = new Buffer(samlResponse, 'base64');

There are more people having issue with SLO: RocketChat/Rocket.Chat#13562

Is there any known to work implementation of SLO with the steffo_meteor-accounts-saml.js code?

@steffow
Copy link
Owner

steffow commented Apr 2, 2019 via email

@pierre-lehnen-rc
Copy link

Hi @steffow , this was indeed a bug on the Rocket.Chat code, it was fixed about a week after the last comment in here, but I only saw this referenced issue today. I believe you can close it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants