Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martimm/auth-scram
authentication using scram
https://github.com/martimm/auth-scram
Last synced: 19 days ago
JSON representation
authentication using scram
- Host: GitHub
- URL: https://github.com/martimm/auth-scram
- Owner: MARTIMM
- License: artistic-2.0
- Created: 2016-08-22T17:51:38.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2022-11-10T19:48:25.000Z (about 2 years ago)
- Last Synced: 2024-10-11T20:51:49.926Z (about 1 month ago)
- Language: Raku
- Size: 987 KB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Salted Challenge Response Authentication Mechanism (SCRAM)
[![Build Status](https://travis-ci.org/MARTIMM/Auth-SCRAM.svg?branch=master)](https://travis-ci.org/MARTIMM/Auth-SCRAM)
[![License](http://martimm.github.io/label/License-label.svg)](http://www.perlfoundation.org/artistic_license_2_0)
This package implements secure authentication mechanism.
## Synopsis
```
# Example from rfc (C = client, s = server)
# C: n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL
# S: r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,s=QSXCR+Q6sek8bf92,i=4096
# C: c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,
# p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=
# S: v=rmF9pqV8S7suAoZWja4dJRkFsKQ=
#
class MyClient {# Send client first message to server and return server response
method client-first ( Str:D $client-first-message --> Str ) {# Send $client-first-message to server;
# Get server response, this is the server first message
'r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,s=QSXCR+Q6sek8bf92,i=4096';
}# Send client final message to server and return server response
method client-final ( Str:D $client-final-message --> Str ) {# Send $client-final-message to server.
# Server response is server final message
'v=rmF9pqV8S7suAoZWja4dJRkFsKQ=';
}method error ( Str:D $message --> Str ) {
# Errors? nah ... (Famous last words!)
}
}my Auth::SCRAM $sc .= new(
:username,
:password,
:client-side(MyClient.new),
);$sc.c-nonce-size = 24;
$sc.c-nonce = 'fyko+d2lbbFgONRv9qkxdawL';my $error = $sc.start-scram;
```## Documentation
* [SCRAM](https://github.com/MARTIMM/Auth-SCRAM/blob/master/doc/SCRAM.pdf)
* [SCRAM::Client](https://github.com/MARTIMM/Auth-SCRAM/blob/master/doc/Client.pdf)
* [SCRAM::Server](https://github.com/MARTIMM/Auth-SCRAM/blob/master/doc/Server.pdf)Change log
* [Release notes](https://github.com/MARTIMM/Auth-SCRAM/blob/master/doc/CHANGES.md)Bugs, todo and known limitations
* [Bugs, todo](https://github.com/MARTIMM/Auth-SCRAM/blob/master/doc/TODO.md)## Installing
Use zef to install the package like so.
```
$ zef install Auth-SCRAM
```## Versions of Raku using moarvm
This project is tested with latest Rakudo built on MoarVM implementing Perl v6.d.
## Authors
```
Marcel Timmerman (MARTIMM on github)
```