SlideShare a Scribd company logo
Creating applications
with Grails, Angular JS
and Spring Security
Álvaro Sánchez-Mariscal
Álvaro Sánchez-Mariscal
Software Engineer
Grails Development Team
@alvaro_sanchez
sanchezmariscala@ociweb.com
Creating applications with Grails, Angular JS and Spring Security - GR8Conf EU 2016
OCI is the new home of Grails
More at ociweb.com/grails
Creating REST
API’s with Grails
The REST Profile
• Targeted at building REST applications.
• REST Specific plugins and commands.
• No GSP, asset pipeline, UI plugins.
• JSON / Markup views instead.
The REST Profile
• Profile specific commands:
• create-domain-resource - creates an
@Resource domain
• create-restful-controller - creates a
RestfulController
The REST Profile
• Statically compiled, extensible JSON views:
json.person	{	
		name	"bob"	
}	
{"person":{"name":"bob"}}
Create the project
$ grails create-app -profile rest-api
-features hibernate,json-views todo
| Application created at /tmp/todo
REST Domain class
package com.example



import grails.rest.Resource



@Resource(uri = '/todos', formats = ['json'])

class Todo {



String description

boolean completed



}
RESTful Controller
package com.example



import grails.rest.RestfulController



class TodoController extends RestfulController {



static responseFormats = ['json']



TodoController() {

super(Todo)

}



def pending() {

respond Todo.findAllByCompleted(false), view: 'index'

}

}
URL Mappings
“/todos"(resources:"todo")
"/pending"(controller: 'todo', action: 'pending')

JSON View
import com.example.Todo



model {

Todo todo

}



json {

hal.links(todo)

id todo.id

description todo.description

completed todo.completed

}
Working with the
Angular JS profile
The Angular JS Profile
• Extends the REST profile.
• Adds project setup for AngularJS.
• Code generation for AngularJS.
• Scaffolding coming soon.
The Angular JS Profile
• Profile specific commands:
• create-ng-controller
• create-ng-service	
• create-ng-domain	
• create-ng-directive	
• create-ng-component	
• create-ng-module
Create the project
$ grails create-app -profile angular
-features hibernate,json-views todo
| Application created at /tmp/todo
Adding Security with
Spring Security REST
Spring Security REST
• Compatibility layer over Spring Security Core.
• Login and logout REST endpoints.
• Token validation filter.
• Stateless by default, with JWT (signed and encrypted)
• Memcached, Redis, GORM and Grails Cache token storages.
• Implicit grant support through 3rd party providers.
• RFC 6750 Bearer Token support.
Create the project
$ grails create-app -profile angular
-features hibernate,json-views,security todo
| Application created at /tmp/todo
The workshop
http://bit.ly/grails-angular-gr8conf

More Related Content

What's hot (20)

PDF
Mastering Grails 3 Plugins - Greach 2016
Alvaro Sanchez-Mariscal
 
PDF
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Alvaro Sanchez-Mariscal
 
PPTX
Angular universal
Michael Haberman
 
PDF
Swagger code motion talk
Victor Trakhtenberg
 
PDF
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
The Software House
 
PPTX
Alfresco Development Framework Basic
Mario Romano
 
PDF
Getting Started With Angular
Stormpath
 
PPT
Introduction To Grails
Christopher Bartling
 
PDF
API Design in the Modern Era - Architecture Next 2020
Eran Stiller
 
PDF
戦う情シス!全社 API で社内アプリ開発を加速させよう
Yuki Hattori
 
PDF
Web view
YAMANE Toshiaki
 
PDF
Improve monitoring and observability for kubernetes with oss tools
Nilesh Gule
 
PDF
JHipster
Yuen-Kuei Hsueh
 
PDF
Swagger UI
Walaa Hamdy Assy
 
PDF
Maarten Balliauw "Indexing and searching NuGet.org with Azure Functions and S...
Fwdays
 
PPTX
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...
Maarten Balliauw
 
PDF
Simple REST-APIs with Dropwizard and Swagger
LeanIX GmbH
 
PPTX
Women Who Code - RSpec JSON API Workshop
Eddie Lau
 
PPTX
Blazor and Azure Functions - a serverless approach
Alex Pshul
 
PDF
Play Framework on Google App Engine
Fred Lin
 
Mastering Grails 3 Plugins - Greach 2016
Alvaro Sanchez-Mariscal
 
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Alvaro Sanchez-Mariscal
 
Angular universal
Michael Haberman
 
Swagger code motion talk
Victor Trakhtenberg
 
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
The Software House
 
Alfresco Development Framework Basic
Mario Romano
 
Getting Started With Angular
Stormpath
 
Introduction To Grails
Christopher Bartling
 
API Design in the Modern Era - Architecture Next 2020
Eran Stiller
 
戦う情シス!全社 API で社内アプリ開発を加速させよう
Yuki Hattori
 
Web view
YAMANE Toshiaki
 
Improve monitoring and observability for kubernetes with oss tools
Nilesh Gule
 
JHipster
Yuen-Kuei Hsueh
 
Swagger UI
Walaa Hamdy Assy
 
Maarten Balliauw "Indexing and searching NuGet.org with Azure Functions and S...
Fwdays
 
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...
Maarten Balliauw
 
Simple REST-APIs with Dropwizard and Swagger
LeanIX GmbH
 
Women Who Code - RSpec JSON API Workshop
Eddie Lau
 
Blazor and Azure Functions - a serverless approach
Alex Pshul
 
Play Framework on Google App Engine
Fred Lin
 

Similar to Creating applications with Grails, Angular JS and Spring Security - GR8Conf EU 2016 (20)

PDF
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Alvaro Sanchez-Mariscal
 
PPTX
Spring Northwest Usergroup Grails Presentation
ajevans
 
PDF
Developing SPI applications using Grails and AngularJS
Alvaro Sanchez-Mariscal
 
PPTX
Building a scalable API with Grails
Tanausu Cerdeña
 
PPTX
Grails Advanced
Saurabh Dixit
 
PDF
Coders Workshop: API First Mobile Development Featuring Angular and Node
Apigee | Google Cloud
 
PPTX
Single-page applications and Grails
Alvaro Sanchez-Mariscal
 
PDF
Gr8Conf 2016 - What's new in Grails 3
graemerocher
 
PDF
Creating RESTful API’s with Grails and Spring Security
Alvaro Sanchez-Mariscal
 
PDF
Groovy - Grails as a modern scripting language for Web applications
IndicThreads
 
PPT
Fast web development using groovy on grails
Anshuman Biswal
 
PDF
Grails 101
Lim Kin
 
PDF
GR8Conf 2011: Adopting Grails
GR8Conf
 
PDF
Adopting Grails - GR8Conf Europe
KlausBaumecker
 
PDF
Grails 101
David Jacobs
 
ODP
Groovy and Grails intro
Miguel Pastor
 
PPTX
Introduction to Grails 2013
Gavin Hogan
 
POT
intoduction to Grails Framework
Harshdeep Kaur
 
PDF
Future of Grails
Daniel Woods
 
PDF
Grails 3.0 Preview
graemerocher
 
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Alvaro Sanchez-Mariscal
 
Spring Northwest Usergroup Grails Presentation
ajevans
 
Developing SPI applications using Grails and AngularJS
Alvaro Sanchez-Mariscal
 
Building a scalable API with Grails
Tanausu Cerdeña
 
Grails Advanced
Saurabh Dixit
 
Coders Workshop: API First Mobile Development Featuring Angular and Node
Apigee | Google Cloud
 
Single-page applications and Grails
Alvaro Sanchez-Mariscal
 
Gr8Conf 2016 - What's new in Grails 3
graemerocher
 
Creating RESTful API’s with Grails and Spring Security
Alvaro Sanchez-Mariscal
 
Groovy - Grails as a modern scripting language for Web applications
IndicThreads
 
Fast web development using groovy on grails
Anshuman Biswal
 
Grails 101
Lim Kin
 
GR8Conf 2011: Adopting Grails
GR8Conf
 
Adopting Grails - GR8Conf Europe
KlausBaumecker
 
Grails 101
David Jacobs
 
Groovy and Grails intro
Miguel Pastor
 
Introduction to Grails 2013
Gavin Hogan
 
intoduction to Grails Framework
Harshdeep Kaur
 
Future of Grails
Daniel Woods
 
Grails 3.0 Preview
graemerocher
 
Ad

More from Alvaro Sanchez-Mariscal (19)

PDF
Serverless functions with Micronaut
Alvaro Sanchez-Mariscal
 
PDF
Asynchronous and event-driven Grails applications
Alvaro Sanchez-Mariscal
 
PDF
6 things you need to know about GORM 6
Alvaro Sanchez-Mariscal
 
PDF
Reactive microservices with Micronaut - GR8Conf EU 2018
Alvaro Sanchez-Mariscal
 
PDF
Reactive microservices with Micronaut - Greach 2018
Alvaro Sanchez-Mariscal
 
PDF
Practical Spring Cloud
Alvaro Sanchez-Mariscal
 
PDF
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Alvaro Sanchez-Mariscal
 
PDF
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Alvaro Sanchez-Mariscal
 
PDF
Stateless authentication for microservices - GR8Conf 2015
Alvaro Sanchez-Mariscal
 
PDF
Ratpack 101 - GR8Conf 2015
Alvaro Sanchez-Mariscal
 
PDF
Ratpack 101 - GeeCON 2015
Alvaro Sanchez-Mariscal
 
PDF
Stateless authentication for microservices - Spring I/O 2015
Alvaro Sanchez-Mariscal
 
PDF
Stateless authentication for microservices - Greach 2015
Alvaro Sanchez-Mariscal
 
PDF
Stateless authentication for microservices applications - JavaLand 2015
Alvaro Sanchez-Mariscal
 
PDF
Stateless authentication for microservices
Alvaro Sanchez-Mariscal
 
PDF
Stateless token-based authentication for pure front-end applications
Alvaro Sanchez-Mariscal
 
PDF
Embrace the frontend revolution
Alvaro Sanchez-Mariscal
 
PDF
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Alvaro Sanchez-Mariscal
 
PDF
DevQA: make your testers happier with Groovy, Spock and Geb
Alvaro Sanchez-Mariscal
 
Serverless functions with Micronaut
Alvaro Sanchez-Mariscal
 
Asynchronous and event-driven Grails applications
Alvaro Sanchez-Mariscal
 
6 things you need to know about GORM 6
Alvaro Sanchez-Mariscal
 
Reactive microservices with Micronaut - GR8Conf EU 2018
Alvaro Sanchez-Mariscal
 
Reactive microservices with Micronaut - Greach 2018
Alvaro Sanchez-Mariscal
 
Practical Spring Cloud
Alvaro Sanchez-Mariscal
 
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Alvaro Sanchez-Mariscal
 
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Alvaro Sanchez-Mariscal
 
Stateless authentication for microservices - GR8Conf 2015
Alvaro Sanchez-Mariscal
 
Ratpack 101 - GR8Conf 2015
Alvaro Sanchez-Mariscal
 
Ratpack 101 - GeeCON 2015
Alvaro Sanchez-Mariscal
 
Stateless authentication for microservices - Spring I/O 2015
Alvaro Sanchez-Mariscal
 
Stateless authentication for microservices - Greach 2015
Alvaro Sanchez-Mariscal
 
Stateless authentication for microservices applications - JavaLand 2015
Alvaro Sanchez-Mariscal
 
Stateless authentication for microservices
Alvaro Sanchez-Mariscal
 
Stateless token-based authentication for pure front-end applications
Alvaro Sanchez-Mariscal
 
Embrace the frontend revolution
Alvaro Sanchez-Mariscal
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Alvaro Sanchez-Mariscal
 
DevQA: make your testers happier with Groovy, Spock and Geb
Alvaro Sanchez-Mariscal
 
Ad

Recently uploaded (20)

PPTX
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
 
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
PDF
Best Software Development at Best Prices
softechies7
 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PDF
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
 
PDF
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
PDF
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
 
PPTX
declaration of Variables and constants.pptx
meemee7378
 
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
DOCX
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
PDF
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
 
PPTX
Agentforce – TDX 2025 Hackathon Achievement
GetOnCRM Solutions
 
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
PDF
Writing Maintainable Playwright Tests with Ease
Shubham Joshi
 
PPTX
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
Best Software Development at Best Prices
softechies7
 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
 
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
 
declaration of Variables and constants.pptx
meemee7378
 
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
 
Agentforce – TDX 2025 Hackathon Achievement
GetOnCRM Solutions
 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
Writing Maintainable Playwright Tests with Ease
Shubham Joshi
 
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 

Creating applications with Grails, Angular JS and Spring Security - GR8Conf EU 2016