SlideShare a Scribd company logo
Basic Auth Implementation
using RAML in Mule
Prepared By: Aditya Kuchan
WHAT IS RAML?
• RAML stands for RESTful API Modeling Language. It's a way of describing
practically-RESTful APIs in a way that's highly readable by both humans and
computers.We say "practically RESTful" because, today in the real world, very few
APIs today actually obey all constraints of REST. RAML isn't strict: for now, it
focuses on cleanly describing resources, methods, parameters, responses, media
types, and other HTTP constructs that form the basis for modern APIs that obey
many, though perhaps not all, RESTful constraints.
• RAML is a non-proprietary, vendor-neutral open spec.The aim is to help our
current API ecosystem and solve immediate problems, and then gently encourage
ever-better API patterns.
• For more details on RAML Refer Below mentioned Link
http://raml.org/about/about-raml
Below is the Defined RAML with Basic OAuth
Configuration
• #%RAML 0.8
• ---
• title: Basic Auth Impl
• baseUri: https://api.sample.com/{version}
• version: v1.0
• securitySchemes:
• - basicAuth:
• description: Requires Basic Authentication for every API request.
• type: Basic Authentication
• securedBy: [basicAuth]
• traits:
• - secured:
• description: Some requests require authentication
• - unsecured:
• description: This is not secured
/SalesforceData:
get:
description: Get Name, ID, OtherCountry, OtherPhone from
Salesforce Account
responses:
200:
body:
application/json:
example: !include get_salesforce_example.json
schema: !include get_salesforce_schema.json
400:
500:
After you Import your .raml file in the studio
it will generate flows with all the mentioned
operations and with Error Codes.
You just need to point to your main flow
where all the operations are performed. In
my case I am pointing to listnerBasicAuth
flow where I am defining operation of
getting the data from salesforce
This is how my main flow looks followed by
.xml in upcoming slides
Xml for the Flow is shown as below• <spring:beans>
• <ss:authentication-manager alias="authenticationManager">
• <ss:authentication-provider>
• <ss:user-service id="userService">
• <ss:user name=“Aditya" password=“Aditya" authorities="ROLE_ADMIN" />
• </ss:user-service>
• </ss:authentication-provider>
• </ss:authentication-manager>
• </spring:beans>
• <mule-ss:security-manager name="SecurityManager" doc:name="Spring Security Provider">
• <mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" />
• </mule-ss:security-manager>
• <sfdc:config name="Salesforce__Basic_Authentication" username="${Username}"
password="${Password}"
• securityToken="${SecurityToken}“
• doc:name="Salesforce: Basic Authentication"/>
• <flow name="listenerBasicAuth">
• <http:basic-security-filter realm="mule-realm"/>
• <mule-ss:http-security-filter realm="mule-realm"/>
• <logger message="#[payload]Checking" level="INFO"
doc:name="Logger"/>
• <sfdc:query config-ref="Salesforce__Basic_Authentication"
query="dsql:SELECT
• AccountId,Id,Name,OtherCountry,OtherPhone FROM Contact
ORDER BY AccountId ASC LIMIT 100 OFFSET 10"
• doc:name="Salesforce"/>
• <logger message="#[message.payloadAs(java.lang.String)]"
level="INFO" doc:name="Logger"/>
• </flow>
Basic auth implementation using raml in mule

More Related Content

PPTX
JSON Logger Baltimore Meetup
PDF
Why API Ops is the Next Wave of DevOps
PPT
Java web services
PPTX
RabbitMQ & Kafka
PPTX
React native development with expo
PDF
Understanding Reactive Programming
PPTX
Dataweave Libraries and ObjectStore
PDF
Building .NET Microservices
JSON Logger Baltimore Meetup
Why API Ops is the Next Wave of DevOps
Java web services
RabbitMQ & Kafka
React native development with expo
Understanding Reactive Programming
Dataweave Libraries and ObjectStore
Building .NET Microservices

What's hot (20)

PPTX
Data weave 2.0 language fundamentals
PPTX
Spring Security 5
PPTX
Progressive Web-App (PWA)
PDF
SPA Editor - Adobe Experience Manager Sites
PDF
ORM: Object-relational mapping
PDF
Camunda Docker
PPTX
Azure serverless architectures
PPTX
API documentation
PPTX
Java script
PDF
Phoenix Framework
PPT
Maven Introduction
ODP
Projects In Laravel : Learn Laravel Building 10 Projects
PPTX
Mule memory leak issue
PDF
REST: From GET to HATEOAS
PDF
Microservice Architecture Patterns, by Richard Langlois P. Eng.
PDF
Scalable webservice
PPTX
Python/Flask Presentation
PDF
REST API and CRUD
PDF
What is API - Understanding API Simplified
PPTX
The Benefits of Using React JS for Web Development!
Data weave 2.0 language fundamentals
Spring Security 5
Progressive Web-App (PWA)
SPA Editor - Adobe Experience Manager Sites
ORM: Object-relational mapping
Camunda Docker
Azure serverless architectures
API documentation
Java script
Phoenix Framework
Maven Introduction
Projects In Laravel : Learn Laravel Building 10 Projects
Mule memory leak issue
REST: From GET to HATEOAS
Microservice Architecture Patterns, by Richard Langlois P. Eng.
Scalable webservice
Python/Flask Presentation
REST API and CRUD
What is API - Understanding API Simplified
The Benefits of Using React JS for Web Development!
Ad

Viewers also liked (18)

PPTX
Ftp connector
ODP
Mule Complete Training
PPTX
SMTP MULE
PPTX
Mule raml
PPTX
Consuming raml
PPT
RAML - The architecture
PPT
PPTX
Welcome, students!
PDF
UF Social Media Strategy
PPTX
Evaluacion del primer quimestre
DOCX
stephaniewilliams-resume
PDF
ISO_welcoming_package
PPTX
M.ega wahyudi 1eb
PPTX
1st day of school 2016
PDF
Revista el-investigador-nro-04
DOCX
Drashyam K Parakh resume
PPTX
Latihan ppt
PPTX
Evaluacion primer quimestre
Ftp connector
Mule Complete Training
SMTP MULE
Mule raml
Consuming raml
RAML - The architecture
Welcome, students!
UF Social Media Strategy
Evaluacion del primer quimestre
stephaniewilliams-resume
ISO_welcoming_package
M.ega wahyudi 1eb
1st day of school 2016
Revista el-investigador-nro-04
Drashyam K Parakh resume
Latihan ppt
Evaluacion primer quimestre
Ad

Similar to Basic auth implementation using raml in mule (20)

PPTX
Design API using RAML - basics
PPTX
Mule soft RAML API Designing
PDF
Api design and development
PPT
1309 leveraging social business data visualizing the connections org structure
PDF
Decoupled cms sunshinephp 2014
PPTX
Raml part 1
PPTX
Phalcon 2 High Performance APIs - DevWeekPOA 2015
PPTX
Design Summit - RESTful API Overview - John Hardy
PPTX
What-is-Laravel and introduciton to Laravel
KEY
CSG 2012
PDF
API Description Languages
PDF
API Description Languages
PPTX
mulesoft birmingham meetup_api_designing_with_raml
PPTX
Ruby on Rails Penetration Testing
PDF
Rails request & middlewares
PDF
API Description Languages: Which Is The Right One For Me?
PPTX
Serverless Applications with AWS SAM
PPT
Innovate2011 Keys to Building OSLC Integrations
PPT
Rails
 
PPTX
API Description Languages: Which is the Right One for Me?
Design API using RAML - basics
Mule soft RAML API Designing
Api design and development
1309 leveraging social business data visualizing the connections org structure
Decoupled cms sunshinephp 2014
Raml part 1
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Design Summit - RESTful API Overview - John Hardy
What-is-Laravel and introduciton to Laravel
CSG 2012
API Description Languages
API Description Languages
mulesoft birmingham meetup_api_designing_with_raml
Ruby on Rails Penetration Testing
Rails request & middlewares
API Description Languages: Which Is The Right One For Me?
Serverless Applications with AWS SAM
Innovate2011 Keys to Building OSLC Integrations
Rails
 
API Description Languages: Which is the Right One for Me?

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharma ospi slides which help in ospi learning
PPTX
master seminar digital applications in india
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Business Ethics Teaching Materials for college
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Structure & Organelles in detailed.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPH.pptx obstetrics and gynecology in nursing
Pharma ospi slides which help in ospi learning
master seminar digital applications in india
VCE English Exam - Section C Student Revision Booklet
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
O7-L3 Supply Chain Operations - ICLT Program
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial disease of the cardiovascular and lymphatic systems
Anesthesia in Laparoscopic Surgery in India
Business Ethics Teaching Materials for college
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Final Presentation General Medicine 03-08-2024.pptx
Week 4 Term 3 Study Techniques revisited.pptx
Microbial diseases, their pathogenesis and prophylaxis
Abdominal Access Techniques with Prof. Dr. R K Mishra

Basic auth implementation using raml in mule

  • 1. Basic Auth Implementation using RAML in Mule Prepared By: Aditya Kuchan
  • 2. WHAT IS RAML? • RAML stands for RESTful API Modeling Language. It's a way of describing practically-RESTful APIs in a way that's highly readable by both humans and computers.We say "practically RESTful" because, today in the real world, very few APIs today actually obey all constraints of REST. RAML isn't strict: for now, it focuses on cleanly describing resources, methods, parameters, responses, media types, and other HTTP constructs that form the basis for modern APIs that obey many, though perhaps not all, RESTful constraints. • RAML is a non-proprietary, vendor-neutral open spec.The aim is to help our current API ecosystem and solve immediate problems, and then gently encourage ever-better API patterns.
  • 3. • For more details on RAML Refer Below mentioned Link http://raml.org/about/about-raml
  • 4. Below is the Defined RAML with Basic OAuth Configuration • #%RAML 0.8 • --- • title: Basic Auth Impl • baseUri: https://api.sample.com/{version} • version: v1.0 • securitySchemes: • - basicAuth: • description: Requires Basic Authentication for every API request. • type: Basic Authentication • securedBy: [basicAuth] • traits: • - secured: • description: Some requests require authentication • - unsecured: • description: This is not secured
  • 5. /SalesforceData: get: description: Get Name, ID, OtherCountry, OtherPhone from Salesforce Account responses: 200: body: application/json: example: !include get_salesforce_example.json schema: !include get_salesforce_schema.json 400: 500:
  • 6. After you Import your .raml file in the studio it will generate flows with all the mentioned operations and with Error Codes. You just need to point to your main flow where all the operations are performed. In my case I am pointing to listnerBasicAuth flow where I am defining operation of getting the data from salesforce
  • 7. This is how my main flow looks followed by .xml in upcoming slides
  • 8. Xml for the Flow is shown as below• <spring:beans> • <ss:authentication-manager alias="authenticationManager"> • <ss:authentication-provider> • <ss:user-service id="userService"> • <ss:user name=“Aditya" password=“Aditya" authorities="ROLE_ADMIN" /> • </ss:user-service> • </ss:authentication-provider> • </ss:authentication-manager> • </spring:beans> • <mule-ss:security-manager name="SecurityManager" doc:name="Spring Security Provider"> • <mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" /> • </mule-ss:security-manager> • <sfdc:config name="Salesforce__Basic_Authentication" username="${Username}" password="${Password}" • securityToken="${SecurityToken}“ • doc:name="Salesforce: Basic Authentication"/>
  • 9. • <flow name="listenerBasicAuth"> • <http:basic-security-filter realm="mule-realm"/> • <mule-ss:http-security-filter realm="mule-realm"/> • <logger message="#[payload]Checking" level="INFO" doc:name="Logger"/> • <sfdc:query config-ref="Salesforce__Basic_Authentication" query="dsql:SELECT • AccountId,Id,Name,OtherCountry,OtherPhone FROM Contact ORDER BY AccountId ASC LIMIT 100 OFFSET 10" • doc:name="Salesforce"/> • <logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/> • </flow>