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

Feature dpop rest #74

Merged
merged 64 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d99b7b3
add oauth2 dpop extension
darsham3 Mar 1, 2021
91cde75
add dpop validity check
darsham3 Mar 1, 2021
12d54b5
code clean up
darsham3 Mar 2, 2021
db91196
Enforce dpop based on application's config
darsham3 Mar 9, 2021
6b79c37
fix alogorithm names
darsham3 Mar 9, 2021
944845f
fix in dpop token issue interceptor
darsham3 Mar 10, 2021
3e2e7da
Refactor DPoP interceptor handler
isuruhettiarachchi Jun 1, 2021
9a9041c
Fix dependency and OSGI issues
nipunthathsara Jul 15, 2021
1d28270
Fix styles and reviews
nipunthathsara Jul 16, 2021
ef957f5
Add constants
kalanika Aug 10, 2021
bbe832b
Register DPoPAuthenticationHandler
kalanika Aug 10, 2021
80fd4be
Fix validateDPoPPayload
kalanika Aug 10, 2021
69b96a5
Add dependency
kalanika Aug 10, 2021
b98a63c
Fix dependency and OSGI issues
kalanika Aug 10, 2021
abdf65d
Add DPoPAuthenticationHandler
kalanika Aug 10, 2021
f9bbb5e
Remove dynamic imports and fix dependency issues
kalanika Aug 10, 2021
3c6e56d
Add Javadoc comment in DPoPAuthenticationHandler
kalanika Aug 11, 2021
d77f2b2
Add checkstyle plugin
kalanika Aug 11, 2021
b2bb2d7
Add code imporvements
kalanika Aug 24, 2021
b655aa1
Add comment line
kalanika Aug 24, 2021
e04ec7c
Add changes to the if condition and canHandle method
kalanika Aug 25, 2021
c63ad83
Add dao package and other changes
kalanika Sep 8, 2021
17afe5c
Add doc comments and remove static,unused imports
kalanika Sep 8, 2021
ddb7772
Remove checkstyle plugin and format pom file
kalanika Sep 8, 2021
e168296
Fix validateSignature method
kalanika Sep 9, 2021
4cfb8c3
Change validateSignature mentod signature
kalanika Sep 9, 2021
0bbfe3d
Remove redundant methods and add into Utils class
kalanika Sep 9, 2021
1ccf01e
Remove unwanted lines
kalanika Sep 9, 2021
08b6f98
Fix null pointer issue
kalanika Sep 9, 2021
3b7467b
Change if condition logic
kalanika Sep 10, 2021
a4c65c3
Add code review changes
kalanika Sep 10, 2021
32a8676
Fix formatting issues
kalanika Sep 10, 2021
260a195
Add code review changes
kalanika Sep 12, 2021
3b27508
Remove todo and format code
kalanika Sep 13, 2021
7fa9a98
Fix getDPoPValidityPeriod method issue
kalanika Sep 13, 2021
a8e41de
Change sql query
kalanika Sep 14, 2021
11785b2
Change exception message for expired dpop proof
kalanika Sep 14, 2021
f67d354
Add readConfigurations to check if the dpop is enabled
kalanika Sep 14, 2021
480f86b
Add setTokenType functionality to AccessTokenIssuer class in auth-oauth
kalanika Sep 15, 2021
8163d35
Change java doc comment and add debug logs
kalanika Sep 15, 2021
1e54f33
Format pom file
kalanika Sep 15, 2021
2eb8bb6
Fix null pointer exception and add debug logs
kalanika Sep 15, 2021
be446f0
Fix issue able to invoke protected API using dpop token with Bearer p…
kalanika Sep 16, 2021
36e6fb6
Add sso binding isTokenValid methods
kalanika Sep 17, 2021
5772058
Add DPoPIntrospectionDataProvider changes
kalanika Sep 21, 2021
d72dca6
Fix null pointer exception
kalanika Sep 21, 2021
36b7d60
Resolve conflicts
kalanika Sep 22, 2021
adf0f8a
Add cnf value method
kalanika Sep 22, 2021
a86ec23
Add tokenbindingValue variable
kalanika Sep 22, 2021
549d192
Add exception handling changes and remove dpop state related codes
kalanika Sep 23, 2021
5f2c699
Add changes to onPostTokenIssue method
kalanika Sep 23, 2021
2315904
Add onPostTokenRenewal method
kalanika Sep 27, 2021
dbd20fa
Add isHashEnabled check
kalanika Sep 30, 2021
3a6b96a
Add isDebugEnabled check and remove log error
kalanika Sep 30, 2021
767d227
Add code changes related to DPoP Binding
kalanika Sep 30, 2021
8fc9f65
Change query
kalanika Oct 1, 2021
72b414a
Add validation related code changes
kalanika Oct 4, 2021
afbb19e
Add DPoPTokenValidator related changes
kalanika Oct 4, 2021
422269b
Set bindingReference as the jkt
kalanika Oct 5, 2021
28e223c
Add code improvement changes
kalanika Oct 6, 2021
7e54c4e
Add infor log and return string.empty
kalanika Oct 25, 2021
28d18c3
Change isEnable config
kalanika Oct 25, 2021
16eb191
Add configuration related code level changes
kalanika Nov 10, 2021
2f463c8
Add readme file
kalanika Nov 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions component/org.wso2.carbon.identity.dpop/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
kalanika marked this conversation as resolved.
Show resolved Hide resolved

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>identity-oauth2-extenstions</artifactId>
<groupId>org.wso2.carbon.extension.identity.oauth.addons</groupId>
<version>2.3.6-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>org.wso2.carbon.identity.dpop</artifactId>
<packaging>bundle</packaging>

<dependencies>
<dependency>
<groupId>org.wso2.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.orbit.com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.event</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.base</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.auth.rest</groupId>
<artifactId>org.wso2.carbon.identity.auth.service</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.core.common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>org.wso2.carbon.identity.dpop</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>
org.wso2.carbon.identity.dpop.internal,
</Private-Package>
<Import-Package>
com.nimbusds.jose.*; version="${nimbusds.osgi.version.range}",
com.nimbusds.jwt; version="${nimbusds.osgi.version.range}",
javax.servlet.http; version="${javax.servlet.http.package.import.version.range}",
org.osgi.framework; version="${osgi.framework.package.import.version.range}",
org.osgi.service.component;
version="${osgi.service.component.package.import.version.range}",
org.apache.commons.logging;
version="${apache.commons.logging.package.import.version.range}",
org.wso2.carbon.identity.oauth.*;
version="${identity.inbound.auth.oauth.imp.pkg.version}",
org.wso2.carbon.identity.oauth2.*;
version="${identity.inbound.auth.oauth.imp.pkg.version}",
org.wso2.carbon.identity.auth.service.*;
version="${identity.carbon.auth.rest.version}",
org.wso2.carbon.identity.base;
version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.core.*;
version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.user.core.util;
version="${carbon.kernel.package.import.version.range}",
org.wso2.carbon.identity.application.common.*;
version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.utils.multitenancy;
version="${carbon.kernel.package.import.version.range}",
org.apache.catalina.*;version="${apache.catalina.version}"
</Import-Package>
<Export-Package>
!org.wso2.carbon.identity.dpop.internal,
org.wso2.carbon.identity.dpop.*; version="${project.version}"
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License
*/

package org.wso2.carbon.identity.dpop.constant;

/**
* This class defines constants for Oauth2 DPoP validation.
*/
public class Constants {

public static final String DPOP_CONFIG_ELEMENT = "OAuth.DPoPConfig";
public static final String HEADER_VALIDITY = "HeaderValidity";
public static final int DEFAULT_HEADER_VALIDITY = 60000;
public static final String DPOP_ISSUED_AT = "iat";
public static final String DPOP_HTTP_URI = "htu";
public static final String DPOP_HTTP_METHOD = "htm";
public static final String DPOP_JWT_TYPE = "dpop+jwt";
public static final String DPOP_TOKEN_TYPE = "DPoP";
public static final String INVALID_DPOP_PROOF = "invalid_dpop_proof";

public static final String ECDSA_ENCRYPTION = "EC";
public static final String RSA_ENCRYPTION = "RSA";

public static final String OAUTH_HEADER = "Bearer";
public static final String OAUTH_DPOP_HEADER = "DPoP";
public static final String CONSUMER_KEY = "consumer-key";
public static final String SERVICE_PROVIDER = "serviceProvider";
public static final String SERVICE_PROVIDER_TENANT_DOMAIN = "serviceProviderTenantDomain";
public static final String SCIM_ME_ENDPOINT_URI = "scim2/me";
kalanika marked this conversation as resolved.
Show resolved Hide resolved
}
Loading