steffow / meteor-accounts-saml

SAML SP tested with OpenAM
27 stars 29 forks source link

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

Open tuxcrafter opened 5 years ago

tuxcrafter commented 5 years ago

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 commented 5 years ago

What software are you using as IdP? Is this SP or IdP initiated SLO?

S.

On 20. Mar 2019, at 21:59, Jelle de Jong notifications@github.com wrote:

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!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

tuxcrafter commented 5 years ago

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 commented 5 years ago

Could y please enable debugging (in settings.js, pls set "debug": true) and send me the log snipplet? I never tried IdP init SLO I think.

S.

On 21. Mar 2019, at 21:37, Jelle de Jong notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

tuxcrafter commented 5 years ago

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 commented 5 years ago

Ah yes. Couple q

a. The SAMLLogout Request seems to encrypted. Correct? b. In the SAML entity config, I see some
tags in the cert value. Could pls check or provide yr settings.js?

S.

On 25. Mar 2019, at 16:20, Jelle de Jong notifications@github.com wrote:

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,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

tuxcrafter commented 5 years ago

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 commented 5 years ago

Pls see “Usage” section in https://github.com/steffow/meteor-accounts-saml/ You should have a settings file that looks similar. Definitely, the
s are strange. However, I would expect SSO to also not work. Is SSO working but SLO not?

tuxcrafter commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

Could y please reach out to the Rocket forums? My implmentation is using Settings.js as mentioned. If Rocket chat is using a different way to provide those params, you should check w them. As I said, the BRs look strange.

On 28. Mar 2019, at 15:48, Jelle de Jong notifications@github.com wrote:

@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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

tuxcrafter commented 5 years ago

@steffow I reached out on RocketChat: https://github.com/RocketChat/Rocket.Chat/issues/13831 and https://github.com/RocketChat/Rocket.Chat/issues/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 commented 5 years ago

@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: https://github.com/RocketChat/Rocket.Chat/issues/13562

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

steffow commented 5 years ago

Could y please reproducing the err without rocketchat? I can conform that SP initiated SLO works fine again OpenAM.

On 2. Apr 2019, at 12:12, Jelle de Jong notifications@github.com wrote:

@steffow I have a javascript debugging the code and it seems to be an bug. 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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.


Steffo Weber, Hamburg

pierre-lehnen-rc commented 4 years ago

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.