{"id":21166732,"url":"https://github.com/eiel/digest_sample","last_synced_at":"2025-03-14T16:47:50.926Z","repository":{"id":7532064,"uuid":"8883792","full_name":"eiel/Digest_Sample","owner":"eiel","description":"iOS で Digest認証するサンプル","archived":false,"fork":false,"pushed_at":"2023-12-15T20:22:58.000Z","size":23,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T10:12:12.608Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eiel.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":"2013-03-19T16:51:50.000Z","updated_at":"2013-12-18T00:46:40.000Z","dependencies_parsed_at":"2022-08-27T18:20:53.225Z","dependency_job_id":null,"html_url":"https://github.com/eiel/Digest_Sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eiel%2FDigest_Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eiel%2FDigest_Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eiel%2FDigest_Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eiel%2FDigest_Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eiel","download_url":"https://codeload.github.com/eiel/Digest_Sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243615571,"owners_count":20319728,"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-11-20T14:52:50.448Z","updated_at":"2025-03-14T16:47:50.901Z","avatar_url":"https://github.com/eiel.png","language":"Objective-C","readme":"# これは何\n\n Digest認証をするのに少しだけ楽する クラスを提供とそのサンプルです。\n\n現在は [AFNetwoking](https://github.com/AFNetworking/AFNetworking) というライブラリのみに対応しています。\n\n以下の感じに使います。\n\n```Objective-C\n    // いろんな場所で使うのであればシングルトンつくって保持させておくとよいかもね\n    ALDigestAuthentication* auth =\n        [[ALDigestAuthentication alloc] initWithUsername:@\"username\"\n                                             andPassword:@\"password\"];\n\n    // アクセス先設定\n    NSURL* url = [NSURL URLWithString:@\"http://localhost:9292\"];\n    NSURLRequest *request = [NSURLRequest requestWithURL:url];\n    // 認証設定済みの AFHTTPRequestOperation を作成する\n    _operation = [auth httpRequestOperation:request];\n\n    __block ALViewController *that = self;\n    [_operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {\n        //成功時\n        that.responseLabel.text = operation.responseString;\n    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {\n        // 失敗時\n        that.responseLabel.text = @\"error\";\n    }];\n    [_operation start];\n```\n\nALDigestAuthentication クラスのインスタンスが 認証時の処理を追加済みの AFHTTPRequestOperation クラスのインスタンスを生成できます。\nあとは AFHTTPRequestOperation を普段通り使用してください。\n\n# 試す方法\n\n```\n$ git clone --recursive git@github.com:eiel/Digest_Sample.git\n```\n\nServer ディレクトリに動作確認用のサーバを起動する Ruby スクリプトがありますので、起動しておきます。\n\n```\n$ cd Server\n$ bundle install\n$ rackup\n```\n\nとすると、ウェブサーバが立ち上がります。\nURLは http://localhost:9292/ です。\n\n初期パスワードは password です。\nユーザ名は特に関係ありません。\n認証に成功すると `hoge` と表示されます。\n\nあとはプロジェクトを開いて実行してください。\n\n# 使い方\n\nALDigestAuthentication ディレクトリをプロジェクトに追加してください。\nAFNetworking も追加していない場合は追加してください。","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feiel%2Fdigest_sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feiel%2Fdigest_sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feiel%2Fdigest_sample/lists"}