Posts

Showing posts from June, 2017

Upload a file in S3 without any form

Uploading a file in S3 is a normal scenario but all I got is uploading the file using a form but what if I want it to upload it without any form. There are very simple steps to upload a file or object in S3 without any form. def s3_resource @s3 = Aws :: S3 :: Resource .new( region : ENV [ 'aws_region' ]) end def s3_bucket s3_resource @s3 .bucket( ENV [ 'aws_bucket' ]) end def upload_file_to_s3 ( file ) s3_resource file_name = File .basename( file ) obj = @s3 .bucket( ENV [ 'aws_bucket' ]).object( 'certificates/' + file_name ) obj .upload_file( file ) end As you can see these methods The first method s3_resource   is just creating a instance of your S3. The second method s3_bucket is initializing your bucket. Now the third one upload_file_to_s3(file) basically uploads your file in S3. In the third method In the first line initiating the s3_resource. In the second line fetching the file_name which can be abc.txt because

SAML IdP initiated SSO Resources Rails

I have been searching a lot for this to implement SAML IdP initiated SSO in Rails. Firstly what I found several resources on it for rails they are very few: 1.) ruby-saml   gem is to implement Service Provider in SAML. 2.) saml_idp gem is to implementing SAML IdP using  but this gem does not provide the way to implement IdP initiated SSO it is for SP initiated SSO. 3.) libsaml which provides the core functionality in SAML IdP but found very hard to implement SAML IdP initiated SSO because @benoist the owner of this gem does not documented it properly even all gems provided for SAML doest not have a proper documentatio. 4.) Another gem is saml_tool which actually provides the way to generate metadata and assertion for SAML request and response. 5.) And Yes, there was a great example for saml idp which saml_tools_demo which describes the use of saml_tools gem. Using Saml_idp and saml_tool gem I finally implemented SAML IdP initiated SSO. And I have described the way