A standards compliant implementation of an OAuth 2.0 authorization server for Nodejs that utilizes JWT and Proof Key for Code Exchange (PKCE), written in TypeScript.
Full Changelog: https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.2.0...v3.3.0
Full Changelog: https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.2.0...v3.3.0-alpha.0
To enable the token exchange grant, you'll need to provide your own implementation of processTokenExchangeFn. This function should orchestrate the exchange with the required third-party services based on your specific needs.
authorizationServer.enableGrant({
grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
processTokenExchangeFn,
})
Thanks to @Jazcash for helping brainstorm and test this feature. Much appreciated 🙏
Full Changelog: https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.1.0...v3.2.0
Full Changelog: https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.0.2...v3.1.0
Full Changelog: https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.0.2...v3.0.3
chore: remove unused dependency from package.json
https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.0.1...v3.0.2
feat: publish commonjs and esm modules using tsup
https://github.com/jasonraimondi/ts-oauth2-server/compare/v3.0.0...v3.0.1
AuthorizationServer
default constructor's parameters have been simplified.AuthorizationServerOptions
default configuration values for have been changed.AuthorizationServer.enableGrantType()
process to enable grant types has been updated.AuthorizationServer.setOptions()
method has been removed. Options should be set during initialization.In v2.x, AuthorizationServer
constructor required all repositories. In v3.x, it has been simplified.
Before (v2.x):
const authorizationServer = new AuthorizationServer(
authCodeRepository,
clientRepository,
accessTokenRepository,
scopeRepository,
userRepository,
jwtService,
{
requiresS256: false,
tokenCID: "name",
}
);
After (v3.x):
const authorizationServer = new AuthorizationServer(
clientRepository,
accessTokenRepository,
scopeRepository,
jwtService,
{
requiresS256: true, // default changed to true
tokenCID: "id", // default changed to "id"
}
);
In v3, enableGrantType has been updated for the "authorization_code" and "password" grants.
AuthorizationCodeGrant now requires a AuthorizationCodeRepository and a UserRepository.
Before (v2.x):
authorizationServer.enableGrantType("authorization_code");
After (v3.x):
authorizationServer.enableGrantType({
grant: "authorization_code",
userRepository,
authorizationCodeRepository,
});
PasswordGrant now requires a UserRepository.
Before (v2.x):
authorizationServer.enableGrantType("password");
After (v3.x):
authorizationServer.enableGrantType({
grant: "password",
userRepository,
});
Thanks to @mahmoudzeyada
https://github.com/jasonraimondi/ts-oauth2-server/compare/v2.6.1...v3.0.0
https://github.com/jasonraimondi/ts-oauth2-server/compare/v2.6.0...v2.6.1