You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oltu.apache.org by "Adam Campbell (JIRA)" <ji...@apache.org> on 2015/10/09 22:40:08 UTC
[jira] [Commented] (OLTU-182) Colons in client secrets are not
supported
[ https://issues.apache.org/jira/browse/OLTU-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14951158#comment-14951158 ]
Adam Campbell commented on OLTU-182:
------------------------------------
I can't figure out how to login to submit PRs, but it's a 4 character fix:
Index: oauth-2.0/common/src/main/java/org/apache/oltu/oauth2/common/utils/OAuthUtils.java
===================================================================
--- oauth-2.0/common/src/main/java/org/apache/oltu/oauth2/common/utils/OAuthUtils.java (revision 1707806)
+++ oauth-2.0/common/src/main/java/org/apache/oltu/oauth2/common/utils/OAuthUtils.java (working copy)
@@ -384,8 +384,8 @@
if (tokens[1] != null && !"".equals(tokens[1])) {
String encodedCreds = tokens[1];
String decodedCreds = new String(Base64.decodeBase64(encodedCreds));
- if (decodedCreds.contains(":") && decodedCreds.split(":").length == 2) {
- String[] creds = decodedCreds.split(":");
+ if (decodedCreds.indexOf(":") && decodedCreds.split(":", 2).length == 2) {
+ String[] creds = decodedCreds.split(":", 2);
if (!OAuthUtils.isEmpty(creds[0]) && !OAuthUtils.isEmpty(creds[1])) {
return decodedCreds.split(":");
}
> Colons in client secrets are not supported
> ------------------------------------------
>
> Key: OLTU-182
> URL: https://issues.apache.org/jira/browse/OLTU-182
> Project: Apache Oltu
> Issue Type: Bug
> Affects Versions: oauth2-1.0.0
> Reporter: Adam Campbell
>
> Let me know if I'm misunderstanding, but it seems like the basic auth spec allows colons in the password: https://tools.ietf.org/html/rfc2617#section-2
> OAuthUtils.decodeClientAuthentication just splits on a colon, thus failing if colons are used in the password.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)