8000 Issue #552 Avoid usage count in SSO opt-out check. by serac · Pull Request #692 · apereo/cas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Issue #552 Avoid usage count in SSO opt-out check. #692

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

Merged < 8000 /span>
merged 1 commit into from
Sep 22, 2014

Conversation

serac
Copy link
Contributor
@serac serac commented Sep 17, 2014

Reorganize code to perform authentication beforehand and store reference
to successful Authentication event that can be consulted for SSO opt-out
check afterward.

Deals with #552

Reorganize code to perform authentication beforehand and store reference
to successful Authentication event that can be consulted for SSO opt-out
check afterward.
@mmoayyed
Copy link
Member

I am OK with this solution, thank you. The only concern I have is, we seem to be executing an unneeded op for a service that is not allowed to do SSO to begin with. That might cause confusion down the road. However, it doesn't seem like that can be avoided...

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 76fd3fd on serac:552-sso-opt-out into a8539cf on Jasig:master.

@serac
Copy link
Contributor Author
serac commented Sep 17, 2014

"we seem to be executing an unneeded op for a service that is not allowed to do SSO to begin with"

You mean authentication is the unneeded operation? Assuming yes, then there are two situations:

  1. User presents credentials and authentication proceeds; assuming it is successful, the opt-out check out would pass and ticket granting would proceed.
  2. User does not present credentials, and the credential check would prevent authentication, and the opt-out check would fail and halt ticket granting.

In either case there is no unnecessary authentication.

@mmoayyed
Copy link
Member

Great. Thanks for clarifying this.

@@ -296,8 +297,11 @@ public String grantServiceTicket(
final List<Authentication> authentications = ticketGrantingTicket.getChainedAuthentications();
final String ticketPrefix = authentications.size() == 1 ? ServiceTicket.PREFIX : ServiceTicket.PROXY_TICKET_PREFIX;
final String ticketId = serviceTicketUniqueTicketIdGenerator.getNewTicketId(ticketPrefix);
final ServiceTicket serviceTicket = ticketGrantingTicket.grantServiceTicket(ticketId, service,
this.serviceTicketExpirationPolicy, credentials != null);
final ServiceTicket serviceTicket = ticketGrantingTicket.grantServiceTicket(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this following our formatter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't know. I've used this style elsewhere [1] and it passed muster (build and review), so I assume it's ok.

[1] https://github.com/Jasig/cas/blob/d38d201a2c594e2bc656b2166a4918f7cdb5867d/cas-server-core/src/main/java/org/jasig/cas/authentication/AuthenticationBuilder.java#L272

@battags
Copy link
Contributor
battags commented Sep 18, 2014

+1

1 similar comment
@leleuj
Copy link
Contributor
leleuj commented Sep 18, 2014

+1

@mmoayyed mmoayyed added this to the 4.1 milestone Sep 20, 2014
mmoayyed pushed a commit that referenced this pull request Sep 22, 2014
Issue #552 Avoid usage count in SSO opt-out check.
@mmoayyed mmoayyed merged commit 94e5100 into apereo:master Sep 22, 2014
@serac serac deleted the 552-sso-opt-out branch September 22, 2014 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0