# שגיאת ArgumentError ב-DiscourseSsoController#sso, מספר שגוי של ארגומנטים (ניתן 1, צפוי 0)

**URL:** <https://meta.discourse.org/t/error-argumenterror-in-discoursessocontroller-sso-wrong-number-of-arguments-given-1-expected-0/184274>\
**Category:** SSO\
**Created:** [24 במרץ,‏ 2021,‏ 9:36am UTC](https://meta.discourse.org/t/error-argumenterror-in-discoursessocontroller-sso-wrong-number-of-arguments-given-1-expected-0/184274 "2021-03-24T09:36:49Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![dscat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dscat/32/203656_2.png) [@dscat](https://meta.discourse.org/u/dscat)\
**Post date:** [21 באוקטובר,‏ 2021,‏ 8:42pm UTC](https://meta.discourse.org/t/error-argumenterror-in-discoursessocontroller-sso-wrong-number-of-arguments-given-1-expected-0/184274/8 "2021-10-21T20:42:52Z")

</div>

Ok, I just ran into this myself.  
It seems the reference implementation uses a feature that works on 2.7+ which is instantiating an object with an empty hash reference.

```plaintext
args = {}
class A; end
A.new(**args) #=> works only if ruby >= 2.7

```

Even in ruby \>= 2.7 the reference code (lib/single\_sign\_on.rb) will raise an error if you were to pass a hash in when calling `#parse` because on lib/single\_sign\_on.rb:65 it calls `sso = new(**init_kwargs)` and `#initialize(secure_session:)` is defined in app/models/discourse\_single\_sign\_on.rb:28 even though `DiscourseSingleSignOn` inherits from `SingleSignOn`

That wouldn’t help people using that code and either use ruby \< 2.7 in their project or pass some kwargs.  
So yes, at the very minimum I think `SingleSignOn` should implement `def initialize(**kwargs);end`

---

_[View the full topic](https://meta.discourse.org/t/error-argumenterror-in-discoursessocontroller-sso-wrong-number-of-arguments-given-1-expected-0/184274)._
