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

CAS Plugin: Upgrade cas libs to support CAS 2.0 protocol #2325

Closed
konsumate opened this issue Feb 24, 2016 · 14 comments · Fixed by #4497
Closed

CAS Plugin: Upgrade cas libs to support CAS 2.0 protocol #2325

konsumate opened this issue Feb 24, 2016 · 14 comments · Fixed by #4497
Assignees
Milestone

Comments

@konsumate
Copy link
Contributor

The current CAS plugin supports only CAS 1.0 which is sufficient to login with a username.

The CAS 2.0 protocol transports user attributes such as Common Name, Email, and even custom attributes. The minimal implementation for CAS 2.0 rocketchat plugin would allow defining a map of attributes, which are parsed from the CAS response and will be mapped towards what RC user attributes:

  • cas_response.email -> rc.user.emails
  • cas_response.fullname -> rc.user.name/profile
@konsumate
Copy link
Contributor Author

One possible candidate which provides CAS 2.0: https://github.com/joshchan/node-cas

@konsumate
Copy link
Contributor Author

Another probably better candidate would be https://www.npmjs.com/package/xcas

@engelgabriel engelgabriel modified the milestone: Important Mar 2, 2016
@konsumate
Copy link
Contributor Author

Tried to use official npmjs modules to provide a CAS 2.0 library - but I failed to find a sane packaged version. Instead I tried to pull in some github module by adding it as local files, but it seems that Meteor doesnt support this practice, yet. I'm not aware of a workaround.

A heads up from @Sing-Li was given to wait till RC switched to Meteor 1.3:
https://github.com/meteor/meteor/blob/release-1.3/packages/module /README.md

@konsumate
Copy link
Contributor Author

konsumate commented Sep 13, 2016

Upgraded my test instance to latest develop state and tried using meteor 1.4 features such as Meteor | Npm.depends and npmjs package definitions

Versions:
rocketchat_1 | npm info using npm@3.10.6
rocketchat_1 | npm info using node@v4.5.0
METEOR@1.4.1.1

Tried using the new package imports as described above:
Npm.depends({
cas: 'https://github.com/joshchan/node-cas/tarball/master'
});

This fails with:
rocketchat_1 | While reading package from '/app/packages/rocketchat-cas':
rocketchat_1 | package.js:29:5: must declare valid version of dependency:
rocketchat_1 | cas@https://github.com/joshchan/node-cas/tarball/master

@Sing-Li Any idea why this fails?

@Sing-Li
Copy link
Member

Sing-Li commented Sep 13, 2016

@CoreCache Meteor 1.4 supports npm modules directly now. Please see https://guide.meteor.com/using-npm-packages.html

Basically, you can just meteor npm install --save <npm package name>

@Sing-Li
Copy link
Member

Sing-Li commented Sep 14, 2016

@RocketChat/core Are we starting to create new package as npm packages now? Are we migrating?

@engelgabriel
Copy link
Member

@rodrigok can you help @CoreCache here?

@engelgabriel engelgabriel modified the milestones: 0.40.0, Important Sep 14, 2016
@rodrigok
Copy link
Member

I'll take a look after the 0.40 release

@engelgabriel engelgabriel modified the milestones: 0.40.0, 0.41.0 Sep 21, 2016
@marceloschmidt
Copy link
Member

@CoreCache please try using this syntax:

Npm.depends({
    cas: 'git+https://github.com/joshchan/node-cas#master'
});

@konsumate
Copy link
Contributor Author

konsumate commented Sep 26, 2016

That seems to work.
According to npmjs - pacjage.json the "Local paths" should work aswell, but when adding something like
cas: "file:test/foobar" or simply cas: "foobar/test" I do get "must declare valid version of dependency" errors

Edit: I want to edit/develop locally before always pushing/fetching from a github repo for local testing

Edit2: Using npm install --save cas@git+https://github.com/joshchan/node-cas#master adds the module to /app/node_modules and adding the absolute path cas: "file:///app/node_modules/cas"' to the package.json seems to load the module correctly at least - but modifying the /app/node_modules/cas module doesnt reload the dev server on modifications. It seems I'm forced to restart and initiate a reload myself.

@engelgabriel
Copy link
Member

engelgabriel commented Sep 26, 2016

https://twitter.com/kcbanner/status/780488898128379906

image

@engelgabriel
Copy link
Member

@CoreCache do you need our help?

@engelgabriel engelgabriel modified the milestones: 0.42.0, 0.41.0 Sep 26, 2016
@konsumate
Copy link
Contributor Author

I'm on a good track now - got early CAS 2.0 response working, but it broke 1.0 ... priceless. I'm on it.

@konsumate
Copy link
Contributor Author

BugFix got merged: joshchan/node-cas@4ae9f7a

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

Successfully merging a pull request may close this issue.

5 participants