{"id":16032772,"url":"https://github.com/threez/gsasl","last_synced_at":"2025-04-01T13:16:22.192Z","repository":{"id":2824251,"uuid":"3826380","full_name":"threez/gsasl","owner":"threez","description":"A lib ffi based wrapper for lib GNU SASL","archived":false,"fork":false,"pushed_at":"2012-05-03T18:31:47.000Z","size":135,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T08:12:39.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/threez/gsasl","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-25T18:43:39.000Z","updated_at":"2013-10-29T05:30:28.000Z","dependencies_parsed_at":"2022-08-25T21:00:41.648Z","dependency_job_id":null,"html_url":"https://github.com/threez/gsasl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fgsasl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fgsasl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fgsasl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threez%2Fgsasl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threez","download_url":"https://codeload.github.com/threez/gsasl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246644097,"owners_count":20810687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T21:40:33.430Z","updated_at":"2025-04-01T13:16:22.166Z","avatar_url":"https://github.com/threez.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GNU SASL for Ruby [![Build Status](https://secure.travis-ci.org/threez/gsasl.png)](http://travis-ci.org/threez/gsasl)\n\nThis libaray is a lib ffi based wrapper for the [GNU SASL](http://www.gnu.org/software/gsasl/) library. It supports a variaty of different authentication mechanisms. Those are the mechanisms supported for the current versions:\n\n* **EXTERNAL**: Authentication via out of band information.\n* **ANONYMOUS**: Mechanism for anonymous access to resources.\n* **PLAIN**: Clear text username and password.\n* **LOGIN**: Non-standard clear text username and password.\n* **CRAM-MD5**: Challenge-Response Authentication Mechanism.\n* **DIGEST-MD5**: Digest Authentication.\n* **SCRAM-SHA-1**: SCRAM-SHA-1 authentication.\n* **SECURID**: Authentication using tokens.\n\nPlatfrom and compile flags dependend mechanisms:\n\n* **NTLM**: Microsoft NTLM authentication.\n* **GSSAPI**: GSSAPI (Kerberos 5) authentication.\n* **GS2-KRB5**: Improved GSSAPI (Kerberos 5) authentication.\n* **KERBEROS\\_V5**: Experimental KERBEROS\\_V5 authentication.\n* **SAML20**: Experimental SAML20 authentication.\n* **OPENID20**: Experimental OPENID20 authentication.\n\n# Install libgsasl\n\nTo use the library the libgsasl must be installed on the system. The gem uses libffi to access the library so no further comilation needed. It also should work with all important versions of ruby.\n\n## Mac OS X\n\nInstall the library using homebrew:\n\n    brew install libgsasl\n    \n## Debian \u0026 Ubuntu\n\nInstall the library using apt-get:\n\n    sudo apt-get install libgsasl7\n\n## FreeBSD\n\nInstall the library using ports (as root):\n\n    cd /usr/ports/security/gsasl/\n    make install clean\n\n# Use in Ruby\n\n## To authenticate against a server\n\nIn this example a client authenticates against an IMAP4 server. The methode `#authenticate_with` is used to setup all the data and callbacks neccessary to perform the authentication.\n\n    # connect to an imap server\n    require 'socket'\n    socket = TCPSocket.new('imap.example.com', 143)\n    puts socket.gets\n    \n    # issue an authenticate command\n    socket.print \"a1 AUTHENTICATE LOGIN\\r\\n\"\n    \n    # authenticate using the imap4 protocol specifics\n    context = Gsasl::Context.new\n    context.authenticate_with(\"LOGIN\", \"user@example.com\", \"secret\") do |remote|\n      remote.receive { socket.gets.gsub!(\"\\r\\n|+\\s\", \"\") }\n      remote.send    { |data| socket.print \"#{data}\\r\\n\" }\n    end\n    \n    # logout\n    puts socket.gets\n    socket.print \"a2 LOGOUT\\r\\n\"\n    \n    # close connection\n    puts socket.gets\n    socket.close\n\n## Advanced\n\nIn the following example the server and the client are on the same machine. If the server is on the remote site, one has to implement a server that will return the next challenge on `server#read` and implements a `server#send` to send the challenge to the server. Also it is possible to not use the `#authenticate` function but to implement the processing individually.\n\n    session = Gsasl::Context.new\n    client = session.create_client(\"CRAM-MD5\")\n    server = session.create_server(\"CRAM-MD5\") do |type, authid|\n      \"secret\" if type = :password \u0026\u0026 authid == \"joe\"\n    end\n    \n    @client.credentials!(\"joe\", \"secret\")\n    @client.authenticate(@server).should be_true\n\n# Copyright Licence\n\nCopyright (c) 2012 Vincent Landgraf All Rights Reserved. Released under a MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fgsasl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreez%2Fgsasl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreez%2Fgsasl/lists"}