Slide 1

Slide 1 text

Fukuoka.rb 2019೥౓্൒ظ׆ಈใࠂ ʙ࣌ʑ Azure AD Libraryʙ FUKUOKA Engineers Day 2019 ~Summer~

Slide 2

Slide 2 text

෱Ԭࢢ๭۠ͷํ͔ΒࢀΓ·ͨ͠ https://fukuokarb.connpass.com/

Slide 3

Slide 3 text

Fukuoka.rb͕ތΔೋେڊ಄ @nagachika @udzura

Slide 4

Slide 4 text

Fukuoka.rb͕ތΔೋେڊ಄ @nagachika @udzura ※ຊ೔ܽ੮

Slide 5

Slide 5 text

ࠓ͠Ό΂͍ͬͯΔਓ • name: “ODA Hirohito” • organization: “i³ Systems, Inc.” • community: {
 fukuokarb: “Host Member”,
 rubykaigi: {
 “2019” => [ “Local Organizer”,
 “LT Speaker”
 ],
 },
 }

Slide 6

Slide 6 text

Fukuoka.rbͱ͸ • ஍Ҭ Rubyist ίϛϡχςΟʔ • ͍͍ͩͨຖिਫ༵೔։࠵ • جຊతʹ΋͘΋͘ձ • ΍Γ͍ͨࣄΛ΍Δ • ੒Ռൃද͸ಛʹͳ͠ • Ruby ʹؔͯ͠΋͘΋͘͢ΔࣄΛਪ঑ • ؾ͕࣋ͪߴ·Δͱ LT େձͱ͔͢Δ • Nishitetsu.rb

Slide 7

Slide 7 text

Fukuoka.rb 2019೥౓্൒ظ࣮੷ • ߹ܭ 23 ճ։࠵ʢ#118ʙ#140ʣ • ௨ৗճ 20 ճ • RejectKaigi 2019ʢ#131ʣ • RubyKaigi 2019 After Hackʢ#132ʣ • LT େձʢ#135ʣ

Slide 8

Slide 8 text

Πϯϓοτ΋େࣄ͕ͩ
 Ξ΢τϓοτ΋େࣄ

Slide 9

Slide 9 text

ϒϩάΛॻ͍ͯΈͨΓ https://ruby-trunk-changes.hatenablog.com/

Slide 10

Slide 10 text

ίϯςφΛࣗ࡞ͯ͠ΈͨΓ https://github.com/haconiwa/haconiwa

Slide 11

Slide 11 text

LTͰ࿩ͯ͠ΈͨΓ https://www.youtube.com/channel/UCwP24-LAmlqxTmv7BuxA6MA

Slide 12

Slide 12 text

RubyKaigiͰొஃͯ͠ΈͨΓ https://rubykaigi.org/2019

Slide 13

Slide 13 text

ͲΜͳܗͰ΋͍͍ͷͰ
 Ξ΢τϓοτ͠Α͏

Slide 14

Slide 14 text

Fukuoka.rbͷࠓޙͷ༧ఆ

Slide 15

Slide 15 text

Fukuoka.rb ͷࠓޙͷ༧ఆ • ࠓ·Ͱ௨Γ΋͘΋͘ճΛܧଓ • ؤுΒͳ͍ • དྷΔऀڋ·ͣڈΔऀ௥Θͣ • ͲͳͨͰ΋ؾܰʹ͓ӽ͍ͩ͘͠͞ • #150 ͋ͨΓͰ LT େձ΍Δ͔΋

Slide 16

Slide 16 text

LTͯ͘͠Εͨํʹ͸ ه೦඼Λଃఄ͠·͢

Slide 17

Slide 17 text

Fukuoka.rk 03 2020 ೥͘Β͍ʁ

Slide 18

Slide 18 text

Ҏ্ɺFukuoka.rb ͷ׆ಈใࠂͰͨ͠

Slide 19

Slide 19 text

Azure AD Library for Ruby ʙ͕࣌ؒ༨ͬͨΒ΍Δ࿩ʙ

Slide 20

Slide 20 text

ʮͲΜͳܗͰ΋͍͍ͷͰΞ΢τϓοτΛ͠Α͏ʯ ͱݴͬͨखલɺ͜ΜͳܗͰΞ΢τϓοτ͠·͢

Slide 21

Slide 21 text

Azure Active Directory https://docs.microsoft.com/ja-jp/azure/active-directory/develop/v1-overview

Slide 22

Slide 22 text

Active Directory Authentication Library(ADAL) https://docs.microsoft.com/ja-jp/azure/active-directory/develop/active-directory- authentication-libraries

Slide 23

Slide 23 text

͋Δ೔ͷग़དྷࣄ ΞΫηετʔΫϯ͕
 ཉ͍͠ΜͰ͚͢Ͳ

Slide 24

Slide 24 text

͋Δ೔ͷग़དྷࣄ RubyͰΞΫηετʔΫϯ͕
 औΕͳ͍Έ͍ͨͰ͢…

Slide 25

Slide 25 text

͋Δ೔ͷग़དྷࣄ ;͊ʂʁ

Slide 26

Slide 26 text

͋Δ೔ͷग़དྷࣄ C#΍Node.jsͳΒ
 औΕΔΈ͍ͨͰ͢…

Slide 27

Slide 27 text

͋Δ೔ͷग़དྷࣄ ;͊ʂʁ

Slide 28

Slide 28 text

Կ͕ى͖͍ͯΔͷ͔ʁ • ΍Γ͍ͨ͜ͱ • ΞΫηετʔΫϯΛऔಘ͍ͨ͠ • Ͱ͖ͳ͍͜ͱ • ADAL for RubyͰΞΫηετʔΫϯ͕औಘͰ͖ͳ͍

Slide 29

Slide 29 text

Α͘Α͘ௐ΂ͯΈΔͱ…

Slide 30

Slide 30 text

Α͘Α͘ௐ΂ͯΈΔͱ… Ruby͸αϙʔτ͞Ε͍ͯͳ͍ʂ

Slide 31

Slide 31 text

Ͳ͏΍Βgem͸͋ΔΒ͍͠ https://rubygems.org/gems/adal

Slide 32

Slide 32 text

https://rubygems.org/gems/adal Ͳ͏΍Βgem͸͋ΔΒ͍͠

Slide 33

Slide 33 text

https://rubygems.org/gems/adal ͦͦ͜͜௕͍͜ͱߋ৽͞Εͯͳ͍… Ͳ͏΍Βgem͸͋ΔΒ͍͠

Slide 34

Slide 34 text

ͱΓ͋͑ͣαϯϓϧίʔυΛ
 ಈ͔ͯ͠ΈΔ

Slide 35

Slide 35 text

αϯϓϧίʔυ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0

Slide 36

Slide 36 text

αϯϓϧίʔυ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0 ಈ͔ͯ͠Έͨ

Slide 37

Slide 37 text

αϯϓϧίʔυ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0 E, [2019-07-19T21:37:07.670568 #98161] ERROR -- ****: Parsed an ErrorResponse with error: invalid_request and error description: AADSTS90002: Tenant '>.onmicrosoft.com' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 12:37:07Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError)

Slide 38

Slide 38 text

αϯϓϧίʔυ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0 E, [2019-07-19T21:37:07.670568 #98161] ERROR -- ****: Parsed an ErrorResponse with error: invalid_request and error description: AADSTS90002: Tenant '>.onmicrosoft.com' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 12:37:07Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError)

Slide 39

Slide 39 text

https://github.com/AzureAD/azure- activedirectory-library-for-ruby/issues/44 • ಉ͡Α͏ͳΤϥʔͰ issue ͕ڍ͕͍ͬͯΔ Issues #44

Slide 40

Slide 40 text

https://github.com/AzureAD/azure- activedirectory-library-for-ruby/issues/ 44#issuecomment-340449070 • ʮ͜ͷίϛοτ ID Λ࢖͑ʂʯͱ͍͏
 ίϝϯτ͕͋ͬͨ Issues #44

Slide 41

Slide 41 text

https://github.com/AzureAD/azure- activedirectory-library-for-ruby/issues/ 44#issuecomment-340449070 • ʮ͜ͷίϛοτ ID Λ࢖͑ʂʯͱ͍͏
 ίϝϯτ͕͋ͬͨ Issues #44 ઌਓͷ஌ܙΛआΓΔ

Slide 42

Slide 42 text

https://github.com/AzureAD/azure- activedirectory-library-for-ruby/issues/ 44#issuecomment-340449070 • ʮ͜ͷίϛοτ ID Λ࢖͑ʂʯͱ͍͏
 ίϝϯτ͕͋ͬͨ Issues #44 E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_request and error description: AADSTS90002: Tenant '.onmicrosoft.com' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError)

Slide 43

Slide 43 text

https://github.com/AzureAD/azure- activedirectory-library-for-ruby/issues/ 44#issuecomment-340449070 • ʮ͜ͷίϛοτ ID Λ࢖͑ʂʯͱ͍͏
 ίϝϯτ͕͋ͬͨ Issues #44 E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_request and error description: AADSTS90002: Tenant '.onmicrosoft.com' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError) ಉ͡Τϥʔ͕ग़Δ…

Slide 44

Slide 44 text

ى͖͍ͯΔࣄ৅Λ֬ೝ͢Δ RubyͰΞΫηετʔΫϯ͕
 औΕͳ͍Β͍͠Ͱ͢…

Slide 45

Slide 45 text

ى͖͍ͯΔࣄ৅Λ֬ೝ͢Δ RubyͰΞΫηετʔΫϯ͕
 औΕͳ͍Β͍͠Ͱ͢… ͲͷΑ͏ͳΤϥʔ͕ग़͍͔ͯͨʁ

Slide 46

Slide 46 text

ى͖͍ͯΔࣄ৅Λ֬ೝ͢Δ RubyͰΞΫηετʔΫϯ͕
 औΕͳ͍Β͍͠Ͱ͢… ͲͷΑ͏ͳΤϥʔ͕ग़͍͔ͯͨʁ `initialize': A JSON text must at least contain two octets! (JSON::ParserError)

Slide 47

Slide 47 text

ى͖͍ͯΔࣄ৅Λ֬ೝ͢Δ RubyͰΞΫηετʔΫϯ͕
 औΕͳ͍Β͍͠Ͱ͢… ͲͷΑ͏ͳΤϥʔ͕ग़͍͔ͯͨʁ `initialize': A JSON text must at least contain two octets! (JSON::ParserError) Τϥʔ಺༰͕ҟͳ͍ͬͯΔ

Slide 48

Slide 48 text

ࠩ෼Λ֬ೝ͢Δ • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '.onmicrosoft.com' • `initialize': A JSON text must at least contain two octets! (JSON::ParserError) • TENANT = 'https://login.microsoftonline.com/'

Slide 49

Slide 49 text

ࠩ෼Λ֬ೝ͢Δ • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '.onmicrosoft.com' • `initialize': A JSON text must at least contain two octets! (JSON::ParserError) • TENANT = 'https://login.microsoftonline.com/' JSON::ParserError Λ௚ͯ͠ΈΔ

Slide 50

Slide 50 text

JSON::ParserError Λ௚ͯ͠ΈΔ • Կ͕ى͖͍͔ͯͨʁ • Ϩεϙϯε͕ JSON σʔλͰ͸ͳۭ͘จࣈ͕ฦ͖͍ͬͯͯΔ • ۭจࣈΛ JSON.parse ͢Δͱ JSON::ParserError Λු༲͢Δ

Slide 51

Slide 51 text

JSON::ParserError Λ௚ͯ͠ΈΔ • Կ͕ى͖͍͔ͯͨʁ • Ϩεϙϯε͕ JSON σʔλͰ͸ͳۭ͘จࣈ͕ฦ͖͍ͬͯͯΔ • ۭจࣈΛ JSON.parse ͢Δͱ JSON::ParserError Λු༲͢Δ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/pull/64

Slide 52

Slide 52 text

JSON::ParserError ͸ղফͰ͖ͨ

Slide 53

Slide 53 text

ADAL::FailureResponse ͸ղফͤͣ

Slide 54

Slide 54 text

ADAL::FailureResponse ͸ղফͤͣ

Slide 55

Slide 55 text

΋͏Ұ౓ࣄ৅Λ֬ೝ͢Δ • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '.onmicrosoft.com'

Slide 56

Slide 56 text

΋͔ͨ͠͠Β… • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = ''

Slide 57

Slide 57 text

΋͔ͨ͠͠Β… • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '' E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_client and error description: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError)

Slide 58

Slide 58 text

΋͔ͨ͠͠Β… • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '' E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_client and error description: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError)

Slide 59

Slide 59 text

΋͔ͨ͠͠Β… • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '' E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_client and error description: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError) Τϥʔϝοηʔδ͕มΘͬͨʂ

Slide 60

Slide 60 text

ΤϥʔϝοηʔδΛ֬ೝ͢Δ • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '' E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_client and error description: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError)

Slide 61

Slide 61 text

ΤϥʔϝοηʔδΛ֬ೝ͢Δ • uninitialized constant ADAL::FailureResponse (NameError) • TENANT = '' E, [2019-07-19T22:18:06.199410 #23399] ERROR -- ****: Parsed an ErrorResponse with error: invalid_client and error description: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'. Trace ID: Correlation ID: **** Timestamp: 2019-07-19 13:18:05Z. ./app.rb:22:in `': uninitialized constant ADAL::FailureResponse (NameError) request body ʹ client_assertion ͔ client_secret ΛؚΊΔඞཁ͕͋Δ

Slide 62

Slide 62 text

αϯϓϧίʔυΛݟ௚͢ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0

Slide 63

Slide 63 text

αϯϓϧίʔυΛݟ௚͢ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0 client_assertion ΋ client_secret ΋ ઃఆ͞Ε͍ͯͳ͍

Slide 64

Slide 64 text

αϯϓϧίʔυΛݟ௚͢ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0 client_secret Λઃఆ͢Δํ޲Ͱվम

Slide 65

Slide 65 text

αϯϓϧίʔυΛݟ௚͢ https://github.com/AzureAD/azure- activedirectory-library-for-ruby/blob/dev/ samples/user_credentials_example/app.rb • Ruby: 2.3.3p222 • adal: 1.0.0 https://github.com/AzureAD/azure- activedirectory-library-for-ruby/pull/65

Slide 66

Slide 66 text

RubyͰΞΫηετʔΫϯΛ औಘͰ͖ΔΑ͏ʹͳͬͨʂ

Slide 67

Slide 67 text

RubyͰΞΫηετʔΫϯΛ औಘͰ͖ΔΑ͏ʹͳͬͨʂ

Slide 68

Slide 68 text

RubyͰΞΫηετʔΫϯΛ औಘͰ͖ΔΑ͏ʹͳͬͨʂ …͕

Slide 69

Slide 69 text

Issues #61 https://github.com/AzureAD/azure-activedirectory-library-for-ruby/issues/61

Slide 70

Slide 70 text

Issues #61 https://github.com/AzureAD/azure-activedirectory-library-for-ruby/issues/61

Slide 71

Slide 71 text

Ruby is Dead https://youtu.be/zb8dXWYUX10

Slide 72

Slide 72 text

Ruby is Dead https://youtu.be/zb8dXWYUX10 • ʮRuby͸ࢮΜͩʯ͸ωλͰ͸͋Δ͕
 ͋·Γؾ෼͕͍͍΋ͷͰ͸ͳ͍ • ϝϯςφϯε͕์ஔ͞Εͯ͠·͏ͱ
 ࣮࣭ࢮΜͩΑ͏ͳ΋ͷ

Slide 73

Slide 73 text

·ͱΊ • ʮ஌Γ߹͍ʹ ADAL for Ruby ͷϝϯςφʔ͕͍Δͧʂʯͱ͍͏ํ͕
 ͍Βͬ͠Ό͍·ͨ͠ΒɺODA ͷ PR ΛϨϏϡʔ͢ΔΑ͏͓఻͍͑ͩ͘͞ • ࢮΜͩαʔϏεʹͳΒͳ͍Α͏࠳͚ͣʹ Contribute ͠ଓ͚Δࣄ͕େࣄ

Slide 74

Slide 74 text

͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠